From f1614b2bddf0934ad0bec210ae60b18f4f80c00f Mon Sep 17 00:00:00 2001 From: Edward Palmer Date: Fri, 28 Jun 2024 14:45:58 +0000 Subject: [PATCH] Removes sources and auxsolvers. --- .../mfem/equation_systems/equation_system.h | 7 +++---- framework/include/mfem/problem/MFEMProblem.h | 5 +---- .../mfem/equation_systems/equation_system.C | 16 +++++---------- framework/src/mfem/problem/MFEMProblem.C | 20 ++----------------- .../equation_system_problem_operator.C | 2 +- ..._domain_equation_system_problem_operator.C | 4 ++-- 6 files changed, 14 insertions(+), 40 deletions(-) diff --git a/framework/include/mfem/equation_systems/equation_system.h b/framework/include/mfem/equation_systems/equation_system.h index 7784051f..0f380ead 100644 --- a/framework/include/mfem/equation_systems/equation_system.h +++ b/framework/include/mfem/equation_systems/equation_system.h @@ -3,7 +3,6 @@ #include "inputs.h" #include "kernel_base.h" #include "named_fields_map.h" -#include "sources.h" namespace platypus { @@ -68,10 +67,10 @@ class EquationSystem : public mfem::Operator const platypus::FESpaces & fespaces, platypus::BCMap & bc_map, platypus::Coefficients & coefficients); - virtual void BuildLinearForms(platypus::BCMap & bc_map, platypus::Sources & sources); + virtual void BuildLinearForms(platypus::BCMap & bc_map); virtual void BuildBilinearForms(); virtual void BuildMixedBilinearForms(); - virtual void BuildEquationSystem(platypus::BCMap & bc_map, platypus::Sources & sources); + virtual void BuildEquationSystem(platypus::BCMap & bc_map); // Form linear system, with essential boundary conditions accounted for virtual void FormLinearSystem(mfem::OperatorHandle & op, @@ -134,7 +133,7 @@ class TimeDependentEquationSystem : public EquationSystem void AddTrialVariableNameIfMissing(const std::string & trial_var_name) override; virtual void SetTimeStep(double dt); - virtual void UpdateEquationSystem(platypus::BCMap & bc_map, platypus::Sources & sources); + virtual void UpdateEquationSystem(platypus::BCMap & bc_map); mfem::ConstantCoefficient _dt_coef; // Coefficient for timestep scaling std::vector _trial_var_time_derivative_names; }; diff --git a/framework/include/mfem/problem/MFEMProblem.h b/framework/include/mfem/problem/MFEMProblem.h index 55b93d98..4481413d 100644 --- a/framework/include/mfem/problem/MFEMProblem.h +++ b/framework/include/mfem/problem/MFEMProblem.h @@ -15,7 +15,6 @@ #include "MFEMBilinearFormKernel.h" #include "MFEMLinearFormKernel.h" #include "MFEMFormulation.h" -#include "MFEMAuxSolver.h" #include "MFEMDataCollection.h" #include "MFEMFESpace.h" #include "Function.h" @@ -109,9 +108,7 @@ class MFEMProblem : public ExternalProblem const std::string & name, InputParameters & parameters) override; /** - * Override of ExternalProblem::addAuxKernel. Uses ExternalProblem::addAuxKernel to create a - * GeneralUserObject representing the auxkernel in MOOSE, and creates corresponding MFEM auxsolver - * to be used in the MFEM solve. + * Override of ExternalProblem::addAuxKernel. */ void addAuxKernel(const std::string & kernel_name, const std::string & name, diff --git a/framework/src/mfem/equation_systems/equation_system.C b/framework/src/mfem/equation_systems/equation_system.C index 216d8fe7..6a3e3366 100644 --- a/framework/src/mfem/equation_systems/equation_system.C +++ b/framework/src/mfem/equation_systems/equation_system.C @@ -285,7 +285,7 @@ EquationSystem::Init(platypus::GridFunctions & gridfunctions, } void -EquationSystem::BuildLinearForms(platypus::BCMap & bc_map, platypus::Sources & sources) +EquationSystem::BuildLinearForms(platypus::BCMap & bc_map) { // Register linear forms for (int i = 0; i < _test_var_names.size(); i++) @@ -313,11 +313,6 @@ EquationSystem::BuildLinearForms(platypus::BCMap & bc_map, platypus::Sources & s lf_kernel->Apply(lf); } } - - if (test_var_name == _test_var_names.at(0)) - { - sources.Apply(lf); - } } } @@ -388,9 +383,9 @@ EquationSystem::BuildMixedBilinearForms() } void -EquationSystem::BuildEquationSystem(platypus::BCMap & bc_map, platypus::Sources & sources) +EquationSystem::BuildEquationSystem(platypus::BCMap & bc_map) { - BuildLinearForms(bc_map, sources); + BuildLinearForms(bc_map); BuildBilinearForms(); BuildMixedBilinearForms(); } @@ -426,10 +421,9 @@ TimeDependentEquationSystem::SetTimeStep(double dt) } void -TimeDependentEquationSystem::UpdateEquationSystem(platypus::BCMap & bc_map, - platypus::Sources & sources) +TimeDependentEquationSystem::UpdateEquationSystem(platypus::BCMap & bc_map) { - BuildLinearForms(bc_map, sources); + BuildLinearForms(bc_map); BuildBilinearForms(); BuildMixedBilinearForms(); } diff --git a/framework/src/mfem/problem/MFEMProblem.C b/framework/src/mfem/problem/MFEMProblem.C index ccb3c249..66dd591a 100644 --- a/framework/src/mfem/problem/MFEMProblem.C +++ b/framework/src/mfem/problem/MFEMProblem.C @@ -186,14 +186,6 @@ MFEMProblem::addCoefficient(const std::string & user_object_name, FEProblemBase::addUserObject(user_object_name, name, parameters); MFEMCoefficient * mfem_coef(&getUserObject(name)); _coefficients._scalars.Register(name, mfem_coef->getCoefficient()); - - // Add associated auxsolvers for CoupledCoefficients - auto coupled_coef = std::dynamic_pointer_cast( - _coefficients._scalars.GetShared(name)); - if (coupled_coef != nullptr) - { - mfem_problem_builder->AddAuxSolver(name, std::move(coupled_coef)); - } } void @@ -271,16 +263,8 @@ MFEMProblem::addAuxKernel(const std::string & kernel_name, { std::string base_auxkernel = parameters.get("_moose_base"); - if (base_auxkernel == "MFEMAuxKernel") // MFEM auxsolver. - { - FEProblemBase::addUserObject(kernel_name, name, parameters); - MFEMAuxSolver * mfem_auxsolver(&getUserObject(name)); - - mfem_problem_builder->AddPostprocessor(name, mfem_auxsolver->getAuxSolver()); - mfem_auxsolver->storeCoefficients(_coefficients); - } - else if (base_auxkernel == "AuxKernel" || base_auxkernel == "VectorAuxKernel" || - base_auxkernel == "ArrayAuxKernel") // MOOSE auxkernels. + if (base_auxkernel == "AuxKernel" || base_auxkernel == "VectorAuxKernel" || + base_auxkernel == "ArrayAuxKernel") // MOOSE auxkernels. { FEProblemBase::addAuxKernel(kernel_name, name, parameters); } diff --git a/framework/src/mfem/problem_operators/equation_system_problem_operator.C b/framework/src/mfem/problem_operators/equation_system_problem_operator.C index 9c9b8fe0..bc9c48e0 100644 --- a/framework/src/mfem/problem_operators/equation_system_problem_operator.C +++ b/framework/src/mfem/problem_operators/equation_system_problem_operator.C @@ -14,7 +14,7 @@ EquationSystemProblemOperator::Init(mfem::Vector & X) { ProblemOperator::Init(X); - GetEquationSystem()->BuildEquationSystem(_problem._bc_map, _problem._sources); + GetEquationSystem()->BuildEquationSystem(_problem._bc_map); } } // namespace platypus \ No newline at end of file diff --git a/framework/src/mfem/problem_operators/time_domain_equation_system_problem_operator.C b/framework/src/mfem/problem_operators/time_domain_equation_system_problem_operator.C index 80e21aca..099fb086 100644 --- a/framework/src/mfem/problem_operators/time_domain_equation_system_problem_operator.C +++ b/framework/src/mfem/problem_operators/time_domain_equation_system_problem_operator.C @@ -24,7 +24,7 @@ TimeDomainEquationSystemProblemOperator::Init(mfem::Vector & X) *(_trial_variable_time_derivatives.at(i)) = 0.0; } - GetEquationSystem()->BuildEquationSystem(_problem._bc_map, _problem._sources); + GetEquationSystem()->BuildEquationSystem(_problem._bc_map); } void @@ -54,7 +54,7 @@ void TimeDomainEquationSystemProblemOperator::BuildEquationSystemOperator(double dt) { GetEquationSystem()->SetTimeStep(dt); - GetEquationSystem()->UpdateEquationSystem(_problem._bc_map, _problem._sources); + GetEquationSystem()->UpdateEquationSystem(_problem._bc_map); GetEquationSystem()->BuildJacobian(_true_x, _true_rhs); }