From 984752167465c9ae357304bdc3d4f18dfb48ae49 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Fri, 15 Mar 2024 14:09:48 -0700 Subject: [PATCH] VectorGridFunctionCoefficient needs mfem v4.6. updated docker. --- docker/Dockerfile | 2 ++ sketches/ns_dg_mms.cpp | 2 +- sketches/ns_rom.cpp | 2 +- src/advdiff_solver.cpp | 3 ++- src/linelast_solver.cpp | 2 +- src/poisson_solver.cpp | 4 ++-- src/rom_handler.cpp | 4 ++-- src/steady_ns_solver.cpp | 2 +- src/stokes_solver.cpp | 4 ++-- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2272c86e..cc30089d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -29,6 +29,8 @@ WORKDIR /usr/lib RUN arch=$(uname -m) && sudo ln -s /usr/lib/${arch}-linux-gnu/libscalapack-openmpi.so.2.1.0 ./ # re-install mfem with mumps, with cmake +WORKDIR $LIB_DIR/mfem +RUN sudo git checkout v4.6 WORKDIR $LIB_DIR/mfem/build RUN sudo -E cmake .. -DBUILD_SHARED_LIBS=YES -DMFEM_USE_MPI=YES -DMFEM_USE_GSLIB=${MG} -DMFEM_USE_METIS=YES -DMFEM_USE_METIS_5=YES -DMFEM_USE_MUMPS=YES -DGSLIB_DIR="$LIB_DIR/gslib/build" -DMUMPS_DIR="$LIB_DIR/mumps/build/local" RUN sudo -E make -j 16 diff --git a/sketches/ns_dg_mms.cpp b/sketches/ns_dg_mms.cpp index e771ee31..45dd2be3 100644 --- a/sketches/ns_dg_mms.cpp +++ b/sketches/ns_dg_mms.cpp @@ -413,7 +413,7 @@ int main(int argc, char *argv[]) MUMPSSolver *J_mumps = NULL; if (direct_solve) { - J_mumps = new MUMPSSolver; + J_mumps = new MUMPSSolver(MPI_COMM_WORLD); J_mumps->SetPrintLevel(-1); J_mumps->SetMatrixSymType(MUMPSSolver::MatType::UNSYMMETRIC); J_solver = J_mumps; diff --git a/sketches/ns_rom.cpp b/sketches/ns_rom.cpp index e578d030..38f0a110 100644 --- a/sketches/ns_rom.cpp +++ b/sketches/ns_rom.cpp @@ -242,7 +242,7 @@ class SteadyNavierStokes : public Operator if (direct_solve) { - J_mumps = new MUMPSSolver(); + J_mumps = new MUMPSSolver(MPI_COMM_WORLD); J_mumps->SetMatrixSymType(MUMPSSolver::MatType::UNSYMMETRIC); J_solver = J_mumps; } diff --git a/src/advdiff_solver.cpp b/src/advdiff_solver.cpp index e100c89a..61bd190d 100644 --- a/src/advdiff_solver.cpp +++ b/src/advdiff_solver.cpp @@ -19,6 +19,7 @@ AdvDiffSolver::AdvDiffSolver() Pe = config.GetOption("adv-diff/peclet_number", 0.0); flow_coeffs.SetSize(numSub); + flow_coeffs = NULL; save_flow = config.GetOption("adv-diff/save_flow", false); load_flow = config.GetOption("adv-diff/load_flow", false); @@ -175,7 +176,7 @@ void AdvDiffSolver::SetParameterizedProblem(ParameterizedProblem *problem) void AdvDiffSolver::SetMUMPSSolver() { assert(globalMat_hypre); - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(MUMPSSolver::MatType::UNSYMMETRIC); mumps->SetOperator(*globalMat_hypre); } diff --git a/src/linelast_solver.cpp b/src/linelast_solver.cpp index d7e7259c..a3e88e58 100644 --- a/src/linelast_solver.cpp +++ b/src/linelast_solver.cpp @@ -292,7 +292,7 @@ void LinElastSolver::AssembleOperator() sys_row_starts[1] = globalMat_mono->NumRows(); globalMat_hypre = new HypreParMatrix(MPI_COMM_WORLD, sys_glob_size, sys_row_starts, globalMat_mono); - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(MUMPSSolver::MatType::SYMMETRIC_POSITIVE_DEFINITE); mumps->SetOperator(*globalMat_hypre); } diff --git a/src/poisson_solver.cpp b/src/poisson_solver.cpp index c768b37f..d9c8844d 100644 --- a/src/poisson_solver.cpp +++ b/src/poisson_solver.cpp @@ -556,7 +556,7 @@ void PoissonSolver::SetParameterizedProblem(ParameterizedProblem *problem) { /* set up boundary types */ MultiBlockSolver::SetParameterizedProblem(problem); - + // clean up rhs for parametrized problem. if (rhs_coeffs.Size() > 0) { @@ -592,7 +592,7 @@ void PoissonSolver::SetParameterizedProblem(ParameterizedProblem *problem) void PoissonSolver::SetMUMPSSolver() { assert(globalMat_hypre); - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(MUMPSSolver::MatType::SYMMETRIC_POSITIVE_DEFINITE); mumps->SetOperator(*globalMat_hypre); } \ No newline at end of file diff --git a/src/rom_handler.cpp b/src/rom_handler.cpp index 6f001d4e..28690f87 100644 --- a/src/rom_handler.cpp +++ b/src/rom_handler.cpp @@ -674,7 +674,7 @@ void MFEMROMHandler::NonlinearSolve(Operator &oper, BlockVector* U, Solver *prec Solver *J_solver = NULL; if (linsol_type == SolverType::DIRECT) { - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(mat_type); mumps->SetPrintLevel(jac_print_level); J_solver = mumps; @@ -1086,7 +1086,7 @@ void MFEMROMHandler::SetupDirectSolver() sys_row_starts[1] = romMat_mono->NumRows(); romMat_hypre = new HypreParMatrix(MPI_COMM_SELF, sys_glob_size, sys_row_starts, romMat_mono); - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(mat_type); mumps->SetOperator(*romMat_hypre); } diff --git a/src/steady_ns_solver.cpp b/src/steady_ns_solver.cpp index 7282fab0..d75785ab 100644 --- a/src/steady_ns_solver.cpp +++ b/src/steady_ns_solver.cpp @@ -645,7 +645,7 @@ bool SteadyNSSolver::Solve() if (direct_solve) { - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(MUMPSSolver::MatType::UNSYMMETRIC); mumps->SetPrintLevel(jac_print_level); J_solver = mumps; diff --git a/src/stokes_solver.cpp b/src/stokes_solver.cpp index b39a2f8a..19e0db9d 100644 --- a/src/stokes_solver.cpp +++ b/src/stokes_solver.cpp @@ -492,7 +492,7 @@ void StokesSolver::SetupMUMPSSolver() sys_row_starts[1] = systemOp_mono->NumRows(); systemOp_hypre = new HypreParMatrix(MPI_COMM_SELF, sys_glob_size, sys_row_starts, systemOp_mono); - mumps = new MUMPSSolver(); + mumps = new MUMPSSolver(MPI_COMM_SELF); mumps->SetMatrixSymType(MUMPSSolver::MatType::SYMMETRIC_POSITIVE_DEFINITE); mumps->SetOperator(*systemOp_hypre); } @@ -1080,7 +1080,7 @@ void StokesSolver::SetParameterizedProblem(ParameterizedProblem *problem) { /* set up boundary types */ MultiBlockSolver::SetParameterizedProblem(problem); - + nu = function_factory::stokes_problem::nu; delete nu_coeff; nu_coeff = new ConstantCoefficient(nu);