Skip to content

Commit

Permalink
VectorGridFunctionCoefficient needs mfem v4.6. updated docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed Mar 15, 2024
1 parent 1c08528 commit 9847521
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sketches/ns_dg_mms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sketches/ns_rom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion src/advdiff_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ AdvDiffSolver::AdvDiffSolver()
Pe = config.GetOption<double>("adv-diff/peclet_number", 0.0);

flow_coeffs.SetSize(numSub);
flow_coeffs = NULL;

save_flow = config.GetOption<bool>("adv-diff/save_flow", false);
load_flow = config.GetOption<bool>("adv-diff/load_flow", false);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/linelast_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/poisson_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions src/rom_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/steady_ns_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/stokes_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9847521

Please sign in to comment.