From c1fb65d6474a9acbbf8510aac093810928aab82e Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Mon, 11 Nov 2024 15:55:48 -0800 Subject: [PATCH 1/5] Do includes/libraries based more off a traditional installation Refs mfem/mfem#4583 --- include/equation_systems/equation_system.h | 2 +- include/integrators/ScaleIntegrator.h | 2 +- include/problem/MFEMProblem.h | 8 ++++---- include/problem_operators/problem_operator.h | 4 ++-- .../time_domain_equation_system_problem_operator.h | 4 ++-- .../problem_operators/time_domain_problem_operator.h | 4 ++-- platypus.mk | 12 ++++++------ src/bcs/MFEMBoundaryCondition.C | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/equation_systems/equation_system.h b/include/equation_systems/equation_system.h index 3c631349..aec26891 100644 --- a/include/equation_systems/equation_system.h +++ b/include/equation_systems/equation_system.h @@ -1,5 +1,5 @@ #pragma once -#include "../common/pfem_extras.hpp" +#include "mfem/miniapps/common/pfem_extras.hpp" #include "boundary_conditions.h" #include "MFEMContainers.h" #include "MFEMKernel.h" diff --git a/include/integrators/ScaleIntegrator.h b/include/integrators/ScaleIntegrator.h index c57b4a58..4a76b334 100644 --- a/include/integrators/ScaleIntegrator.h +++ b/include/integrators/ScaleIntegrator.h @@ -1,6 +1,6 @@ #pragma once #include "MFEMGeneralUserObject.h" -#include "../common/pfem_extras.hpp" +#include "mfem/miniapps/common/pfem_extras.hpp" namespace platypus { diff --git a/include/problem/MFEMProblem.h b/include/problem/MFEMProblem.h index 0cb766da..21006d9a 100644 --- a/include/problem/MFEMProblem.h +++ b/include/problem/MFEMProblem.h @@ -1,6 +1,6 @@ #pragma once #include -#include "../common/pfem_extras.hpp" +#include "mfem/miniapps/common/pfem_extras.hpp" #include "ExternalProblem.h" #include "MFEMProblemData.h" #include "MFEMMesh.h" @@ -22,12 +22,12 @@ class MFEMProblem : public ExternalProblem static InputParameters validParams(); MFEMProblem(const InputParameters & params); - virtual ~MFEMProblem(){}; + virtual ~MFEMProblem() {}; virtual void initialSetup() override; - virtual void externalSolve() override{}; + virtual void externalSolve() override {}; virtual bool nlConverged(const unsigned int nl_sys_num) override { return true; }; - virtual void syncSolutions(Direction direction) override{}; + virtual void syncSolutions(Direction direction) override {}; /** * Overwritten mesh() method from base MooseMesh to retrieve the correct mesh type, in this case diff --git a/include/problem_operators/problem_operator.h b/include/problem_operators/problem_operator.h index 6d39ec03..18b333bf 100644 --- a/include/problem_operators/problem_operator.h +++ b/include/problem_operators/problem_operator.h @@ -1,5 +1,5 @@ #pragma once -#include "../common/pfem_extras.hpp" +#include "mfem/miniapps/common/pfem_extras.hpp" #include "MFEMProblemData.h" #include "problem_operator_interface.h" @@ -18,4 +18,4 @@ class ProblemOperator : public mfem::Operator, public ProblemOperatorInterface void Mult(const mfem::Vector & x, mfem::Vector & y) const override {} }; -} // namespace platypus \ No newline at end of file +} // namespace platypus diff --git a/include/problem_operators/time_domain_equation_system_problem_operator.h b/include/problem_operators/time_domain_equation_system_problem_operator.h index 71200b45..c2c45288 100644 --- a/include/problem_operators/time_domain_equation_system_problem_operator.h +++ b/include/problem_operators/time_domain_equation_system_problem_operator.h @@ -1,5 +1,5 @@ #pragma once -#include "../common/pfem_extras.hpp" +#include "mfem/miniapps/common/pfem_extras.hpp" #include "time_domain_problem_operator.h" #include "problem_operator_interface.h" #include "equation_system_interface.h" @@ -42,4 +42,4 @@ class TimeDomainEquationSystemProblemOperator : public TimeDomainProblemOperator std::shared_ptr _equation_system{nullptr}; }; -} // namespace platypus \ No newline at end of file +} // namespace platypus diff --git a/include/problem_operators/time_domain_problem_operator.h b/include/problem_operators/time_domain_problem_operator.h index 4c902186..cb1e30a2 100644 --- a/include/problem_operators/time_domain_problem_operator.h +++ b/include/problem_operators/time_domain_problem_operator.h @@ -1,5 +1,5 @@ #pragma once -#include "../common/pfem_extras.hpp" +#include "mfem/miniapps/common/pfem_extras.hpp" #include "MFEMProblemData.h" #include "problem_operator_interface.h" @@ -21,4 +21,4 @@ class TimeDomainProblemOperator : public mfem::TimeDependentOperator, void ImplicitSolve(const double dt, const mfem::Vector & X, mfem::Vector & dX_dt) override {} }; -} // namespace platypus \ No newline at end of file +} // namespace platypus diff --git a/platypus.mk b/platypus.mk index a20aad62..31d4a355 100644 --- a/platypus.mk +++ b/platypus.mk @@ -1,11 +1,11 @@ -MFEM_DIR :=$(APPLICATION_DIR)/../mfem/build +MFEM_DIR ?=$(APPLICATION_DIR)/../mfem/build +MFEM_INC_DIR ?=$(MFEM_DIR)/include -include $(MFEM_DIR)/config/config.mk -MFEM_INCLUDES := -I$(MFEM_INC_DIR)/config -I$(MFEM_DIR)/ -I$(MFEM_DIR)/../miniapps/common $(MFEM_INCFLAGS) -MFEM_LIBS := -L$(MFEM_DIR) -lmfem -lrt -L$(MFEM_DIR)/miniapps/common -lmfem-common $(MFEM_LIB) +MFEM_INCLUDES := -I$(MFEM_DIR)/include +MFEM_LIBS := -Wl,-rpath,$(MFEM_DIR)/lib -L$(MFEM_DIR)/lib -lmfem -lrt -lmfem-common ADDITIONAL_INCLUDES += $(MFEM_INCLUDES) -ADDITIONAL_LIBS += -Wl, $(MFEM_LIBS) ${MFEM_EXT_LIBS} +ADDITIONAL_LIBS += $(MFEM_LIBS) ${MFEM_EXT_LIBS} $(info ADDITIONAL_INCLUDES = $(ADDITIONAL_INCLUDES)); -$(info ADDITIONAL_LIBS = $(ADDITIONAL_LIBS)); \ No newline at end of file +$(info ADDITIONAL_LIBS = $(ADDITIONAL_LIBS)); diff --git a/src/bcs/MFEMBoundaryCondition.C b/src/bcs/MFEMBoundaryCondition.C index 227fdaa2..4949e4f7 100644 --- a/src/bcs/MFEMBoundaryCondition.C +++ b/src/bcs/MFEMBoundaryCondition.C @@ -1,5 +1,5 @@ #include "MFEMBoundaryCondition.h" -#include "mesh_extras.hpp" +#include "mfem/miniapps/common/mesh_extras.hpp" InputParameters MFEMBoundaryCondition::validParams() From 7342c209643056cbf3aa1e88b5e20d211704193e Mon Sep 17 00:00:00 2001 From: Nuno Nobre Date: Thu, 19 Dec 2024 22:51:14 +0000 Subject: [PATCH 2/5] Change include path for mfem-common.hpp --- unit/src/MFEMEssentialBCTest.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit/src/MFEMEssentialBCTest.C b/unit/src/MFEMEssentialBCTest.C index 43934cd3..ab171474 100644 --- a/unit/src/MFEMEssentialBCTest.C +++ b/unit/src/MFEMEssentialBCTest.C @@ -1,4 +1,4 @@ -#include "mfem-common.hpp" +#include "mfem/miniapps/common/mfem-common.hpp" #include "MFEMObjectUnitTest.h" #include "MFEMScalarDirichletBC.h" #include "MFEMScalarFunctionDirichletBC.h" From ccbbfc315b74f599b21757d951513d867ddac520 Mon Sep 17 00:00:00 2001 From: Nuno Nobre Date: Tue, 26 Nov 2024 13:57:22 -0800 Subject: [PATCH 3/5] Do the bare minimum in platypus.mk --- platypus.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/platypus.mk b/platypus.mk index 31d4a355..1a9ed643 100644 --- a/platypus.mk +++ b/platypus.mk @@ -1,11 +1,9 @@ -MFEM_DIR ?=$(APPLICATION_DIR)/../mfem/build -MFEM_INC_DIR ?=$(MFEM_DIR)/include +MFEM_DIR ?= $(APPLICATION_DIR)/../mfem/installed -MFEM_INCLUDES := -I$(MFEM_DIR)/include -MFEM_LIBS := -Wl,-rpath,$(MFEM_DIR)/lib -L$(MFEM_DIR)/lib -lmfem -lrt -lmfem-common +include $(MFEM_DIR)/share/mfem/config.mk -ADDITIONAL_INCLUDES += $(MFEM_INCLUDES) -ADDITIONAL_LIBS += $(MFEM_LIBS) ${MFEM_EXT_LIBS} +ADDITIONAL_INCLUDES += $(MFEM_INCFLAGS) +ADDITIONAL_LIBS += $(MFEM_LIBS) -lmfem-common $(info ADDITIONAL_INCLUDES = $(ADDITIONAL_INCLUDES)); $(info ADDITIONAL_LIBS = $(ADDITIONAL_LIBS)); From 596ddff5ccb1f4087cd45162b4d372ed584d34fc Mon Sep 17 00:00:00 2001 From: Alex Lindsay Date: Thu, 19 Dec 2024 12:54:49 -0800 Subject: [PATCH 4/5] Code linting --- include/problem/MFEMProblem.h | 6 +++--- include/problem_operators/problem_operator.h | 2 +- include/problem_operators/time_domain_problem_operator.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/problem/MFEMProblem.h b/include/problem/MFEMProblem.h index 21006d9a..03442324 100644 --- a/include/problem/MFEMProblem.h +++ b/include/problem/MFEMProblem.h @@ -25,9 +25,9 @@ class MFEMProblem : public ExternalProblem virtual ~MFEMProblem() {}; virtual void initialSetup() override; - virtual void externalSolve() override {}; - virtual bool nlConverged(const unsigned int nl_sys_num) override { return true; }; - virtual void syncSolutions(Direction direction) override {}; + virtual void externalSolve() override {} + virtual bool nlConverged(const unsigned int) override { return true; } + virtual void syncSolutions(Direction) override {} /** * Overwritten mesh() method from base MooseMesh to retrieve the correct mesh type, in this case diff --git a/include/problem_operators/problem_operator.h b/include/problem_operators/problem_operator.h index 18b333bf..ef3dd02a 100644 --- a/include/problem_operators/problem_operator.h +++ b/include/problem_operators/problem_operator.h @@ -15,7 +15,7 @@ class ProblemOperator : public mfem::Operator, public ProblemOperatorInterface void SetGridFunctions() override; virtual void Solve(mfem::Vector & X) {} - void Mult(const mfem::Vector & x, mfem::Vector & y) const override {} + void Mult(const mfem::Vector &, mfem::Vector &) const override {} }; } // namespace platypus diff --git a/include/problem_operators/time_domain_problem_operator.h b/include/problem_operators/time_domain_problem_operator.h index cb1e30a2..e99576ea 100644 --- a/include/problem_operators/time_domain_problem_operator.h +++ b/include/problem_operators/time_domain_problem_operator.h @@ -18,7 +18,7 @@ class TimeDomainProblemOperator : public mfem::TimeDependentOperator, void SetGridFunctions() override; - void ImplicitSolve(const double dt, const mfem::Vector & X, mfem::Vector & dX_dt) override {} + void ImplicitSolve(const double, const mfem::Vector &, mfem::Vector &) override {} }; } // namespace platypus From a31c2d4330d0cad8b1f9baaf12702071e0376620 Mon Sep 17 00:00:00 2001 From: Nuno Nobre Date: Thu, 19 Dec 2024 23:03:27 +0000 Subject: [PATCH 5/5] More code linting --- include/problem/MFEMProblem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/problem/MFEMProblem.h b/include/problem/MFEMProblem.h index 03442324..f072f20a 100644 --- a/include/problem/MFEMProblem.h +++ b/include/problem/MFEMProblem.h @@ -22,7 +22,7 @@ class MFEMProblem : public ExternalProblem static InputParameters validParams(); MFEMProblem(const InputParameters & params); - virtual ~MFEMProblem() {}; + virtual ~MFEMProblem() {} virtual void initialSetup() override; virtual void externalSolve() override {}