diff --git a/framework/doc/content/source/mfem/functions/MFEMGradientGridFunction.md b/framework/doc/content/source/mfem/functions/MFEMGradientGridFunction.md new file mode 100644 index 000000000000..9fba78e3a1f3 --- /dev/null +++ b/framework/doc/content/source/mfem/functions/MFEMGradientGridFunction.md @@ -0,0 +1,16 @@ +# MFEMGradientGridFunction + +!if! function=hasCapability('mfem') + +## Summary + +This is class which can be use as vector cofficients to MFEM problems. + +## Overview + +`MFEMGradientGridFunction` is intended to allow the specification of `mfem::VectorCoefficient` object to add to the MFEM problem in a manner consistent with the standard MOOSE Materials system. + +!if-end! + +!else +!include mfem/mfem_warning.md diff --git a/framework/doc/content/source/mfem/kernels/MFEMDomainLFGradKernel.md b/framework/doc/content/source/mfem/kernels/MFEMDomainLFGradKernel.md new file mode 100644 index 000000000000..75c7a5437b2d --- /dev/null +++ b/framework/doc/content/source/mfem/kernels/MFEMDomainLFGradKernel.md @@ -0,0 +1,35 @@ +# MFEMDomainLFGradKernel + +!if! function=hasCapability('mfem') + +!syntax description /Kernels/MFEMDomainLFGradKernel + +## Overview + +Adds the domain integrator for integrating the linear form + +!equation +(\vec{f}, \nabla v)_\Omega \,\,\, \forall v \in V + +where $v \in H^1$ is the test variable and $\vec{f}$ is a +vector forcing coefficient. + +This term arises from the weak form of the forcing term + +!equation +-\nabla \cdot \vec{f} + +## Example Input File Syntax + +!listing mfem/kernels/nldiffusion.i block=/Kernels + +!syntax parameters /Kernels/MFEMDomainLFGradKernel + +!syntax inputs /Kernels/MFEMDomainLFGradKernel + +!syntax children /Kernels/MFEMDomainLFGradKernel + +!if-end! + +!else +!include mfem/mfem_warning.md \ No newline at end of file diff --git a/framework/doc/content/source/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.md b/framework/doc/content/source/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.md new file mode 100644 index 000000000000..bae58508d510 --- /dev/null +++ b/framework/doc/content/source/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.md @@ -0,0 +1,35 @@ +# MFEMMixedScalarWeakDivergenceKernel + +!if! function=hasCapability('mfem') + +!syntax description /Kernels/MFEMMixedScalarWeakDivergenceKernel + +## Overview + +Adds the domain integrator for integrating the bilinear form + +!equation +(-\vec{\lambda} u, \nabla v)_\Omega \,\,\, \forall v \in V + +where $v \in H^1$ is the test variable and $\vec{\lambda}$ is a +vector forcing coefficient. + +This term arises from the weak form of the forcing term + +!equation +\nabla \cdot(\vec{\lambda} u) + +## Example Input File Syntax + +!listing mfem/kernels/nldiffusion.i block=/Kernels + +!syntax parameters /Kernels/MFEMMixedScalarWeakDivergenceKernel + +!syntax inputs /Kernels/MFEMMixedScalarWeakDivergenceKernel + +!syntax children /Kernels/MFEMMixedScalarWeakDivergenceKernel + +!if-end! + +!else +!include mfem/mfem_warning.md \ No newline at end of file diff --git a/framework/include/mfem/equation_systems/EquationSystem.h b/framework/include/mfem/equation_systems/EquationSystem.h index 8e41fd3afaa0..5928cae23769 100644 --- a/framework/include/mfem/equation_systems/EquationSystem.h +++ b/framework/include/mfem/equation_systems/EquationSystem.h @@ -54,13 +54,15 @@ class EquationSystem : public mfem::Operator /// Build linear forms and eliminate constrained DoFs virtual void BuildLinearForms(); + virtual void BuildNonLinearActions(); virtual void ApplyEssentialBCs(); virtual void EliminateCoupledVariables(); /// Build bilinear forms virtual void BuildBilinearForms(); virtual void BuildMixedBilinearForms(); - virtual void BuildEquationSystem(); + virtual void BuildEquationSystem(Moose::MFEM::GridFunctions & gridfunctions, + mfem::Array & btoffsets); /// Form linear system, with essential boundary conditions accounted for virtual void FormLinearSystem(mfem::OperatorHandle & op, @@ -73,6 +75,8 @@ class EquationSystem : public mfem::Operator mfem::BlockVector & trueX, mfem::BlockVector & trueRHS); + void UpdateJacobian() const; + /// Build linear system, with essential boundary conditions accounted for virtual void BuildJacobian(mfem::BlockVector & trueX, mfem::BlockVector & trueRHS); @@ -131,7 +135,7 @@ class EquationSystem : public mfem::Operator // Components of weak form. // Named according to test variable Moose::MFEM::NamedFieldsMap _blfs; Moose::MFEM::NamedFieldsMap _lfs; - Moose::MFEM::NamedFieldsMap _nlfs; + Moose::MFEM::NamedFieldsMap _nlfs; Moose::MFEM::NamedFieldsMap> _mblfs; // named according to trial variable @@ -153,6 +157,12 @@ class EquationSystem : public mfem::Operator Moose::MFEM::NamedFieldsMap< Moose::MFEM::NamedFieldsMap>>> & kernels_map); + void ApplyDomainNLActionIntegrators( + const std::string & test_var_name, + std::shared_ptr form, + Moose::MFEM::NamedFieldsMap< + Moose::MFEM::NamedFieldsMap>>> & kernels_map); + template void ApplyBoundaryBLFIntegrators( const std::string & trial_var_name, @@ -188,8 +198,16 @@ class EquationSystem : public mfem::Operator Moose::MFEM::NamedFieldsMap>> _essential_bc_map; mutable mfem::OperatorHandle _jacobian; + mutable mfem::Vector _trueRHS; + mutable mfem::BlockVector _trueBlockRHS, _trueBlockSol, _BlockResidual; + + Moose::MFEM::GridFunctions * _gfuncs; + mfem::Array * _block_true_offsets; + mfem::Array empty_tdof; mfem::AssemblyLevel _assembly_level; + + bool _non_linear = false; }; template @@ -240,6 +258,30 @@ EquationSystem::ApplyDomainLFIntegrators( } } +inline void +EquationSystem::ApplyDomainNLActionIntegrators( + const std::string & test_var_name, + std::shared_ptr form, + Moose::MFEM::NamedFieldsMap< + Moose::MFEM::NamedFieldsMap>>> & kernels_map) +{ + if (kernels_map.Has(test_var_name) && kernels_map.Get(test_var_name)->Has(test_var_name)) + { + auto kernels = kernels_map.GetRef(test_var_name).GetRef(test_var_name); + for (auto & kernel : kernels) + { + mfem::LinearFormIntegrator * integ = kernel->createNLActionIntegrator(); + if (integ != nullptr) + { + _non_linear = true; + kernel->isSubdomainRestricted() + ? form->AddDomainIntegrator(std::move(integ), kernel->getSubdomainMarkers()) + : form->AddDomainIntegrator(std::move(integ)); + } + } + } +} + template void EquationSystem::ApplyBoundaryBLFIntegrators( @@ -303,7 +345,8 @@ class TimeDependentEquationSystem : public EquationSystem void AddCoupledVariableNameIfMissing(const std::string & coupled_var_name) override; virtual void SetTimeStep(mfem::real_t dt); - virtual void UpdateEquationSystem(); + virtual void UpdateEquationSystem(Moose::MFEM::GridFunctions & gridfunctions, + mfem::Array & btoffsets); virtual void AddKernel(std::shared_ptr kernel) override; virtual void BuildBilinearForms() override; @@ -314,6 +357,8 @@ class TimeDependentEquationSystem : public EquationSystem mfem::BlockVector & truedXdt, mfem::BlockVector & trueRHS) override; + void UpdateEssDerivativeVals(const mfem::real_t & dt, const mfem::Vector & x_old); + protected: /// Coefficient for timestep scaling mfem::ConstantCoefficient _dt_coef; diff --git a/framework/include/mfem/executioners/MFEMProblemSolve.h b/framework/include/mfem/executioners/MFEMProblemSolve.h index 03f415786771..ff9fa7b30836 100644 --- a/framework/include/mfem/executioners/MFEMProblemSolve.h +++ b/framework/include/mfem/executioners/MFEMProblemSolve.h @@ -35,6 +35,10 @@ class MFEMProblemSolve : public SolveObject protected: MFEMProblem & _mfem_problem; std::vector> & _problem_operators; + unsigned int _nl_max_its; + mfem::real_t _nl_abs_tol; + mfem::real_t _nl_rel_tol; + unsigned int _print_level; }; #endif diff --git a/framework/include/mfem/functions/MFEMGradientGridFunction.h b/framework/include/mfem/functions/MFEMGradientGridFunction.h new file mode 100644 index 000000000000..d913a414e4ee --- /dev/null +++ b/framework/include/mfem/functions/MFEMGradientGridFunction.h @@ -0,0 +1,32 @@ +//* This file is part of the MOOSE framework +//* https://mooseframework.inl.gov +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#ifdef MOOSE_MFEM_ENABLED + +#pragma once + +#include "MFEMGeneralUserObject.h" + +/** + * Declares arbitrary parsed function of position, time, and any number of problem variables. + */ +class MFEMGradientGridFunction : public MFEMGeneralUserObject +{ +public: + static InputParameters validParams(); + + MFEMGradientGridFunction(const InputParameters & parameters); + virtual ~MFEMGradientGridFunction(); + +protected: + /// grid function variable variable + const VariableName & _var_name; +}; + +#endif diff --git a/framework/include/mfem/kernels/MFEMDomainLFGradKernel.h b/framework/include/mfem/kernels/MFEMDomainLFGradKernel.h new file mode 100644 index 000000000000..29ae8f051884 --- /dev/null +++ b/framework/include/mfem/kernels/MFEMDomainLFGradKernel.h @@ -0,0 +1,34 @@ +//* This file is part of the MOOSE framework +//* https://mooseframework.inl.gov +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#ifdef MOOSE_MFEM_ENABLED + +#pragma once +#include "MFEMKernel.h" + +/** + * \f[ + * (f, v) + * \f] + */ +class MFEMDomainLFGradKernel : public MFEMKernel +{ +public: + static InputParameters validParams(); + + MFEMDomainLFGradKernel(const InputParameters & parameters); + + virtual mfem::LinearFormIntegrator * createNLActionIntegrator() override; + +protected: + mfem::Coefficient & _coef; + mfem::ScalarVectorProductCoefficient * _product_coeff; +}; + +#endif diff --git a/framework/include/mfem/kernels/MFEMKernel.h b/framework/include/mfem/kernels/MFEMKernel.h index beeba72bf66a..d6917d964a6d 100644 --- a/framework/include/mfem/kernels/MFEMKernel.h +++ b/framework/include/mfem/kernels/MFEMKernel.h @@ -29,6 +29,7 @@ class MFEMKernel : public MFEMGeneralUserObject, public MFEMBlockRestrictable /// Create a new MFEM integrator to apply to the weak form. Ownership managed by the caller. virtual mfem::LinearFormIntegrator * createLFIntegrator() { return nullptr; } + virtual mfem::LinearFormIntegrator * createNLActionIntegrator() { return nullptr; } virtual mfem::BilinearFormIntegrator * createBFIntegrator() { return nullptr; } /// Get name of the test variable labelling the weak form this kernel is added to diff --git a/framework/include/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.h b/framework/include/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.h new file mode 100644 index 000000000000..e74077eaf81d --- /dev/null +++ b/framework/include/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.h @@ -0,0 +1,34 @@ +//* This file is part of the MOOSE framework +//* https://mooseframework.inl.gov +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#ifdef MOOSE_MFEM_ENABLED + +#pragma once +#include "MFEMKernel.h" + +/** + * \f[ + * (k \vec \nabla u, \vec \nabla v) + * \f] + */ +class MFEMMixedScalarWeakDivergenceKernel : public MFEMKernel +{ +public: + static InputParameters validParams(); + + MFEMMixedScalarWeakDivergenceKernel(const InputParameters & parameters); + + virtual mfem::BilinearFormIntegrator * createBFIntegrator() override; + +protected: + mfem::Coefficient & _coef; + mfem::ScalarVectorProductCoefficient * _product_coef; +}; + +#endif diff --git a/framework/include/mfem/problem/MFEMProblem.h b/framework/include/mfem/problem/MFEMProblem.h index 4701e555e381..1a6f98c2d09c 100644 --- a/framework/include/mfem/problem/MFEMProblem.h +++ b/framework/include/mfem/problem/MFEMProblem.h @@ -210,8 +210,20 @@ class MFEMProblem : public ExternalProblem */ std::shared_ptr getGridFunction(const std::string & name); + /** + * set newton solver parameters + */ + void setNewtonParamaters(unsigned int nl_max_its, + mfem::real_t nl_abs_tol, + mfem::real_t nl_rel_tol, + unsigned int print_level); + protected: MFEMProblemData _problem_data; + unsigned int _nl_max_its; + mfem::real_t _nl_abs_tol; + mfem::real_t _nl_rel_tol; + unsigned int _print_level; }; #endif diff --git a/framework/src/mfem/equation_systems/EquationSystem.C b/framework/src/mfem/equation_systems/EquationSystem.C index 769e05b33b72..f6a754cdcb00 100644 --- a/framework/src/mfem/equation_systems/EquationSystem.C +++ b/framework/src/mfem/equation_systems/EquationSystem.C @@ -130,29 +130,29 @@ EquationSystem::Init(Moose::MFEM::GridFunctions & gridfunctions, { _assembly_level = assembly_level; - for (auto & test_var_name : _test_var_names) + // Extract which coupled variables are to be trivially eliminated and which are trial variables + SetTrialVariableNames(); + + for (auto & trial_var_name : _trial_var_names) { - if (!gridfunctions.Has(test_var_name)) + if (!gridfunctions.Has(trial_var_name)) { mooseError("MFEM variable ", - test_var_name, + trial_var_name, " requested by equation system during initialisation was " "not found in gridfunctions"); } // Store pointers to test FESpaces - _test_pfespaces.push_back(gridfunctions.Get(test_var_name)->ParFESpace()); + _test_pfespaces.push_back(gridfunctions.Get(trial_var_name)->ParFESpace()); // Create auxiliary gridfunctions for storing essential constraints from Dirichlet conditions _var_ess_constraints.emplace_back( - std::make_unique(gridfunctions.Get(test_var_name)->ParFESpace())); + std::make_unique(gridfunctions.Get(trial_var_name)->ParFESpace())); } // Store pointers to FESpaces of all coupled variables for (auto & coupled_var_name : _coupled_var_names) _coupled_pfespaces.push_back(gridfunctions.Get(coupled_var_name)->ParFESpace()); - // Extract which coupled variables are to be trivially eliminated and which are trial variables - SetTrialVariableNames(); - // Store pointers to coupled variable GridFunctions that are to be eliminated prior to forming the // jacobian for (auto & eliminated_var_name : _eliminated_var_names) @@ -325,13 +325,107 @@ EquationSystem::BuildJacobian(mfem::BlockVector & trueX, mfem::BlockVector & tru } void -EquationSystem::Mult(const mfem::Vector & x, mfem::Vector & residual) const +EquationSystem::Mult(const mfem::Vector & sol, mfem::Vector & residual) const { - _jacobian->Mult(x, residual); - x.HostRead(); + static_cast(_trueBlockSol) = sol; + for (unsigned int i = 0; i < _trial_var_names.size(); i++) + { + auto & trial_var_name = _trial_var_names.at(i); + _gfuncs->Get(trial_var_name)->Distribute(&(_trueBlockSol.GetBlock(i))); + } + + UpdateJacobian(); + + _BlockResidual = 0.0; + + if (_non_linear) + { + for (unsigned int i = 0; i < _test_var_names.size(); i++) + { + auto & test_var_name = _test_var_names.at(i); + + int offset = _BlockResidual.GetBlock(i).Size(); + mfem::Vector b(offset); + + auto lf = _lfs.GetShared(test_var_name); + lf->Assemble(); + lf->ParallelAssemble(b); + + auto nlf = _nlfs.GetShared(test_var_name); + nlf->Assemble(); + nlf->ParallelAssemble(_BlockResidual.GetBlock(i)); + + _BlockResidual.GetBlock(i) -= b; + _BlockResidual.GetBlock(i) *= -1; + + _BlockResidual.GetBlock(i).SetSubVector(_ess_tdof_lists.at(i), 0.0); + } + + residual = static_cast(_BlockResidual); + const_cast(this)->FormLinearSystem(_jacobian, _trueBlockSol, _BlockResidual); + } + + residual *= -1.0; + + if (!_non_linear) + { + residual = 0.0; + _jacobian->Mult(sol, residual); + } + + sol.HostRead(); residual.HostRead(); } +void +TimeDependentEquationSystem::UpdateEssDerivativeVals(const mfem::real_t & dt, + const mfem::Vector & x_old) +{ + mfem::ParGridFunction u_old_gf; + mfem::BlockVector block_x_old(const_cast(x_old), *_block_true_offsets); + + // Update the xs boundary conditions + ApplyEssentialBCs(); + + // Update the dxdts boundary conditions + for (unsigned int i = 0; i < _test_var_names.size(); i++) + { + u_old_gf.SetSpace(_test_pfespaces[i]); + u_old_gf.SetFromTrueDofs(block_x_old.GetBlock(i)); + *(_var_ess_constraints.at(i)) -= u_old_gf; + *(_var_ess_constraints.at(i)) /= dt; + } +} + +void +EquationSystem::UpdateJacobian() const +{ + + for (unsigned int i = 0; i < _test_var_names.size(); i++) + { + auto & test_var_name = _test_var_names.at(i); + auto blf = _blfs.Get(test_var_name); + blf->Update(); + blf->Assemble(); + } + + // Form off-diagonal blocks + for (unsigned int i = 0; i < _test_var_names.size(); i++) + { + auto test_var_name = _test_var_names.at(i); + for (unsigned int j = 0; j < _test_var_names.size(); j++) + { + auto trial_var_name = _test_var_names.at(j); + if (_mblfs.Has(test_var_name) && _mblfs.Get(test_var_name)->Has(trial_var_name)) + { + auto mblf = _mblfs.Get(test_var_name)->Get(trial_var_name); + mblf->Update(); + mblf->Assemble(); + } + } + } +} + mfem::Operator & EquationSystem::GetGradient(const mfem::Vector &) const { @@ -361,9 +455,6 @@ EquationSystem::BuildLinearForms() _lfs.GetRef(test_var_name) = 0.0; } - // Apply boundary conditions - ApplyEssentialBCs(); - for (auto & test_var_name : _test_var_names) { // Apply kernels @@ -377,6 +468,26 @@ EquationSystem::BuildLinearForms() EliminateCoupledVariables(); } +void +EquationSystem::BuildNonLinearActions() +{ + // Register linear forms + for (const auto i : index_range(_test_var_names)) + { + auto test_var_name = _test_var_names.at(i); + _nlfs.Register(test_var_name, std::make_shared(_test_pfespaces.at(i))); + _nlfs.GetRef(test_var_name) = 0.0; + } + + for (auto & test_var_name : _test_var_names) + { + // Apply kernels + auto nlf = _nlfs.GetShared(test_var_name); + ApplyDomainNLActionIntegrators(test_var_name, nlf, _kernels_map); + nlf->Assemble(); + } +} + void EquationSystem::BuildBilinearForms() { @@ -438,11 +549,18 @@ EquationSystem::BuildMixedBilinearForms() } void -EquationSystem::BuildEquationSystem() +EquationSystem::BuildEquationSystem(Moose::MFEM::GridFunctions & gridfunctions, + mfem::Array & btoffsets) { + _gfuncs = &gridfunctions; + _block_true_offsets = &btoffsets; + _trueBlockRHS.Update(*_block_true_offsets); + _trueBlockSol.Update(*_block_true_offsets); + _BlockResidual.Update(*_block_true_offsets); BuildBilinearForms(); BuildMixedBilinearForms(); BuildLinearForms(); + BuildNonLinearActions(); } TimeDependentEquationSystem::TimeDependentEquationSystem() : _dt_coef(1.0) {} @@ -599,13 +717,14 @@ TimeDependentEquationSystem::FormLegacySystem(mfem::OperatorHandle & op, // } mfem::Vector aux_x, aux_rhs; // Update solution values on Dirichlet values to be in terms of du/dt instead of u - mfem::Vector bc_x = *(_var_ess_constraints.at(i).get()); - bc_x -= *_eliminated_variables.Get(test_var_name); - bc_x /= _dt_coef.constant; + // mfem::Vector bc_x = *(_var_ess_constraints.at(i).get()); + // bc_x -= *_eliminated_variables.Get(test_var_name); + // bc_x /= _dt_coef.constant; // Form linear system for operator acting on vector of du/dt mfem::HypreParMatrix * aux_a = new mfem::HypreParMatrix; - td_blf->FormLinearSystem(_ess_tdof_lists.at(i), bc_x, *lf, *aux_a, aux_x, aux_rhs); + td_blf->FormLinearSystem( + _ess_tdof_lists.at(i), *(_var_ess_constraints.at(i)), *lf, *aux_a, aux_x, aux_rhs); _h_blocks(i, i) = aux_a; truedXdt.GetBlock(i) = aux_x; trueRHS.GetBlock(i) = aux_rhs; @@ -637,13 +756,14 @@ TimeDependentEquationSystem::FormSystem(mfem::OperatorHandle & op, // } mfem::Vector aux_x, aux_rhs; // Update solution values on Dirichlet values to be in terms of du/dt instead of u - mfem::Vector bc_x = *(_var_ess_constraints.at(0).get()); - bc_x -= *_eliminated_variables.Get(test_var_name); - bc_x /= _dt_coef.constant; + // mfem::Vector bc_x = *(_var_ess_constraints.at(0).get()); + // bc_x -= *_eliminated_variables.Get(test_var_name); + // bc_x /= _dt_coef.constant; // Form linear system for operator acting on vector of du/dt mfem::OperatorPtr aux_a; - td_blf->FormLinearSystem(_ess_tdof_lists.at(0), bc_x, *lf, aux_a, aux_x, aux_rhs); + td_blf->FormLinearSystem( + _ess_tdof_lists.at(0), *(_var_ess_constraints.at(0)), *lf, aux_a, aux_x, aux_rhs); truedXdt.GetBlock(0) = aux_x; trueRHS.GetBlock(0) = aux_rhs; @@ -656,9 +776,10 @@ TimeDependentEquationSystem::FormSystem(mfem::OperatorHandle & op, } void -TimeDependentEquationSystem::UpdateEquationSystem() +TimeDependentEquationSystem::UpdateEquationSystem(Moose::MFEM::GridFunctions & gridfunctions, + mfem::Array & btoffsets) { - EquationSystem::BuildEquationSystem(); + EquationSystem::BuildEquationSystem(gridfunctions, btoffsets); } } // namespace Moose::MFEM diff --git a/framework/src/mfem/executioners/MFEMProblemSolve.C b/framework/src/mfem/executioners/MFEMProblemSolve.C index 7e54771df137..7ed313e4b2e1 100644 --- a/framework/src/mfem/executioners/MFEMProblemSolve.C +++ b/framework/src/mfem/executioners/MFEMProblemSolve.C @@ -18,6 +18,10 @@ MFEMProblemSolve::validParams() { InputParameters params = emptyInputParameters(); params.addClassDescription("Solve object for MFEM problems."); + params.addParam("nl_max_its", 1, "Max Nonlinear Iterations"); + params.addParam("nl_abs_tol", 1.0e-50, "Nonlinear Absolute Tolerance"); + params.addParam("nl_rel_tol", 1.0e-8, "Nonlinear Relative Tolerance"); + params.addParam("print_level", 1, "Print level"); params.addParam("device", "Run app on the chosen device."); MooseEnum assembly_levels("legacy full element partial none", "legacy", true); params.addParam("assembly_level", assembly_levels, "Matrix assembly level."); @@ -29,7 +33,11 @@ MFEMProblemSolve::MFEMProblemSolve( std::vector> & problem_operators) : SolveObject(ex), _mfem_problem(dynamic_cast(_problem)), - _problem_operators(problem_operators) + _problem_operators(problem_operators), + _nl_max_its(getParam("nl_max_its")), + _nl_abs_tol(getParam("nl_abs_tol")), + _nl_rel_tol(getParam("nl_rel_tol")), + _print_level(getParam("print_level")) { if (const auto compute_device = _app.getComputeDevice()) _app.setMFEMDevice(*compute_device, Moose::PassKey()); @@ -38,6 +46,8 @@ MFEMProblemSolve::MFEMProblemSolve( : _app.isUltimateMaster() ? "cpu" : "", Moose::PassKey()); + + _mfem_problem.setNewtonParamaters(_nl_max_its, _nl_abs_tol, _nl_rel_tol, _print_level); } bool diff --git a/framework/src/mfem/functions/MFEMGradientGridFunction.C b/framework/src/mfem/functions/MFEMGradientGridFunction.C new file mode 100644 index 000000000000..989e9ff365f7 --- /dev/null +++ b/framework/src/mfem/functions/MFEMGradientGridFunction.C @@ -0,0 +1,37 @@ +//* This file is part of the MOOSE framework +//* https://mooseframework.inl.gov +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#ifdef MOOSE_MFEM_ENABLED + +#include "MFEMGradientGridFunction.h" +#include "MFEMProblem.h" + +registerMooseObject("MooseApp", MFEMGradientGridFunction); + +InputParameters +MFEMGradientGridFunction::validParams() +{ + InputParameters params = MFEMGeneralUserObject::validParams(); + params.registerBase("Function"); + params.addClassDescription("Creates a GradientGridFunctionCoefficient out of a variable"); + params.addRequiredParam("var_name", "The names of the gridfunction variable"); + return params; +} + +MFEMGradientGridFunction::MFEMGradientGridFunction(const InputParameters & parameters) + : MFEMGeneralUserObject(parameters), _var_name(getParam("var_name")) +{ + // declares GradientGridFunctionCoefficient + getMFEMProblem().getCoefficients().declareVector( + name(), getMFEMProblem().getProblemData().gridfunctions.Get(_var_name)); +} + +MFEMGradientGridFunction::~MFEMGradientGridFunction() {} + +#endif diff --git a/framework/src/mfem/kernels/MFEMDomainLFGradKernel.C b/framework/src/mfem/kernels/MFEMDomainLFGradKernel.C new file mode 100644 index 000000000000..a22c41c26a06 --- /dev/null +++ b/framework/src/mfem/kernels/MFEMDomainLFGradKernel.C @@ -0,0 +1,46 @@ +//* This file is part of the MOOSE framework +//* https://mooseframework.inl.gov +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#ifdef MOOSE_MFEM_ENABLED + +#include "MFEMDomainLFGradKernel.h" +#include "MFEMProblem.h" + +registerMooseObject("MooseApp", MFEMDomainLFGradKernel); + +InputParameters +MFEMDomainLFGradKernel::validParams() +{ + InputParameters params = MFEMKernel::validParams(); + params.addClassDescription("Adds the domain integrator to an MFEM problem for the linear form " + "$(f, v)_\\Omega$ " + "arising from the weak form of the forcing term $f$."); + params.addParam( + "coefficient", "1.", "The name of the scalar coefficient f"); + return params; +} + +MFEMDomainLFGradKernel::MFEMDomainLFGradKernel(const InputParameters & parameters) + : MFEMKernel(parameters), _coef(getScalarCoefficient("coefficient")) +{ + // declares GradientGridFunctionCoefficient + getMFEMProblem().getCoefficients().declareVector( + name(), getMFEMProblem().getProblemData().gridfunctions.Get(_test_var_name)); +} + +mfem::LinearFormIntegrator * +MFEMDomainLFGradKernel::createNLActionIntegrator() +{ + mfem::VectorCoefficient & vec_coef = + getMFEMProblem().getCoefficients().getVectorCoefficient(name()); + _product_coeff = new mfem::ScalarVectorProductCoefficient(_coef, vec_coef); + return new mfem::DomainLFGradIntegrator(*_product_coeff); +} + +#endif diff --git a/framework/src/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.C b/framework/src/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.C new file mode 100644 index 000000000000..16da14a2391d --- /dev/null +++ b/framework/src/mfem/kernels/MFEMMixedScalarWeakDivergenceKernel.C @@ -0,0 +1,50 @@ +//* This file is part of the MOOSE framework +//* https://mooseframework.inl.gov +//* +//* All rights reserved, see COPYRIGHT for full restrictions +//* https://github.com/idaholab/moose/blob/master/COPYRIGHT +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + +#ifdef MOOSE_MFEM_ENABLED + +#include "MFEMMixedScalarWeakDivergenceKernel.h" +#include "MFEMProblem.h" + +registerMooseObject("MooseApp", MFEMMixedScalarWeakDivergenceKernel); + +InputParameters +MFEMMixedScalarWeakDivergenceKernel::validParams() +{ + InputParameters params = MFEMKernel::validParams(); + params.addClassDescription("Adds the domain integrator to an MFEM problem for the bilinear form " + "$(k\\vec\\nabla u, \\vec\\nabla v)_\\Omega$ " + "arising from the weak form of the Laplacian operator " + "$- \\vec\\nabla \\cdot \\left( k \\vec \\nabla u \\right)$."); + params.addParam( + "coefficient", "1.", "Name of property for MixedScalarWeakDivergence coefficient k."); + return params; +} + +MFEMMixedScalarWeakDivergenceKernel::MFEMMixedScalarWeakDivergenceKernel( + const InputParameters & parameters) + : MFEMKernel(parameters), _coef(getScalarCoefficient("coefficient")) +// FIXME: The MFEM bilinear form can also handle vector and matrix +// coefficients, so ideally we'd handle all three too. +{ + // declares GradientGridFunctionCoefficient + getMFEMProblem().getCoefficients().declareVector( + name(), getMFEMProblem().getProblemData().gridfunctions.Get(_test_var_name)); +} + +mfem::BilinearFormIntegrator * +MFEMMixedScalarWeakDivergenceKernel::createBFIntegrator() +{ + mfem::VectorCoefficient & vec_coef = + getMFEMProblem().getCoefficients().getVectorCoefficient(name()); + _product_coef = new mfem::ScalarVectorProductCoefficient(_coef, vec_coef); + return new mfem::MixedScalarWeakDivergenceIntegrator(*_product_coef); +} + +#endif diff --git a/framework/src/mfem/problem/MFEMProblem.C b/framework/src/mfem/problem/MFEMProblem.C index b969a872db55..279eba2565ae 100644 --- a/framework/src/mfem/problem/MFEMProblem.C +++ b/framework/src/mfem/problem/MFEMProblem.C @@ -79,9 +79,10 @@ MFEMProblem::addMFEMNonlinearSolver() auto nl_solver = std::make_shared(getProblemData().comm); // Defaults to one iteration, without further nonlinear iterations - nl_solver->SetRelTol(0.0); - nl_solver->SetAbsTol(0.0); - nl_solver->SetMaxIter(1); + nl_solver->SetRelTol(_nl_rel_tol); + nl_solver->SetAbsTol(_nl_abs_tol); + nl_solver->SetPrintLevel(_print_level); + nl_solver->SetMaxIter(_nl_max_its); getProblemData().nonlinear_solver = nl_solver; } @@ -326,6 +327,12 @@ MFEMProblem::addFunction(const std::string & type, const std::string & name, InputParameters & parameters) { + if (type == "MFEMGradientGridFunction") + { + FEProblemBase::addUserObject(type, name, parameters); + return; + } + ExternalProblem::addFunction(type, name, parameters); auto & func = getFunction(name); // FIXME: Do we want to have optimised versions for when functions @@ -503,6 +510,18 @@ MFEMProblem::getGridFunction(const std::string & name) return getUserObject(name).getGridFunction(); } +void +MFEMProblem::setNewtonParamaters(unsigned int nl_max_its, + mfem::real_t nl_abs_tol, + mfem::real_t nl_rel_tol, + unsigned int print_level) +{ + _nl_max_its = nl_max_its; + _nl_abs_tol = nl_abs_tol; + _nl_rel_tol = nl_rel_tol; + _print_level = print_level; +} + void MFEMProblem::addInitialCondition(const std::string & ic_name, const std::string & name, diff --git a/framework/src/mfem/problem_operators/EquationSystemProblemOperator.C b/framework/src/mfem/problem_operators/EquationSystemProblemOperator.C index 677421b1e38b..aaa115496d29 100644 --- a/framework/src/mfem/problem_operators/EquationSystemProblemOperator.C +++ b/framework/src/mfem/problem_operators/EquationSystemProblemOperator.C @@ -26,12 +26,21 @@ EquationSystemProblemOperator::Init(mfem::BlockVector & X) { ProblemOperator::Init(X); - GetEquationSystem()->BuildEquationSystem(); + GetEquationSystem()->BuildEquationSystem(_problem_data.gridfunctions, _block_true_offsets); } void EquationSystemProblemOperator::Solve() { + + for (const auto i : index_range(_test_var_names)) + { + auto & test_var_name = _test_var_names.at(i); + *(GetEquationSystem()->_var_ess_constraints.at(i)) = + *(_problem_data.gridfunctions.GetShared(test_var_name)); + } + + GetEquationSystem()->ApplyEssentialBCs(); GetEquationSystem()->BuildJacobian(_true_x, _true_rhs); if (_problem_data.jacobian_solver->isLOR() && _equation_system->_test_var_names.size() > 1) @@ -41,9 +50,15 @@ EquationSystemProblemOperator::Solve() *_equation_system->_blfs.Get(_equation_system->_test_var_names.at(0)), _equation_system->_ess_tdof_lists.at(0)); + mfem::Vector zero_vec(_true_rhs.Size()); + zero_vec = 0.0; _problem_data.nonlinear_solver->SetSolver(_problem_data.jacobian_solver->getSolver()); _problem_data.nonlinear_solver->SetOperator(*GetEquationSystem()); - _problem_data.nonlinear_solver->Mult(_true_rhs, _true_x); + + if (!(GetEquationSystem()->_non_linear)) + _problem_data.nonlinear_solver->Mult(_true_rhs, _true_x); + else + _problem_data.nonlinear_solver->Mult(zero_vec, _true_x); GetEquationSystem()->RecoverFEMSolution(_true_x, _problem_data.gridfunctions); } diff --git a/framework/src/mfem/problem_operators/TimeDomainEquationSystemProblemOperator.C b/framework/src/mfem/problem_operators/TimeDomainEquationSystemProblemOperator.C index 75cb1647cbd5..488ad92a5d97 100644 --- a/framework/src/mfem/problem_operators/TimeDomainEquationSystemProblemOperator.C +++ b/framework/src/mfem/problem_operators/TimeDomainEquationSystemProblemOperator.C @@ -26,7 +26,7 @@ void TimeDomainEquationSystemProblemOperator::Init(mfem::BlockVector & X) { TimeDomainProblemOperator::Init(X); - GetEquationSystem()->BuildEquationSystem(); + GetEquationSystem()->BuildEquationSystem(_problem_data.gridfunctions, _block_true_offsets); // Set timestepper auto & ode_solver = _problem_data.ode_solver; ode_solver = std::make_unique(); @@ -47,10 +47,11 @@ TimeDomainEquationSystemProblemOperator::Solve() void TimeDomainEquationSystemProblemOperator::ImplicitSolve(const mfem::real_t dt, - const mfem::Vector & /*X*/, + const mfem::Vector & X, mfem::Vector & dX_dt) { dX_dt = 0.0; + GetEquationSystem()->UpdateEssDerivativeVals(dt, X); SetTestVariablesFromTrueVectors(); for (unsigned int ind = 0; ind < _trial_variables.size(); ++ind) { @@ -67,9 +68,18 @@ TimeDomainEquationSystemProblemOperator::ImplicitSolve(const mfem::real_t dt, *_equation_system->_blfs.Get(_equation_system->_test_var_names.at(0)), _equation_system->_ess_tdof_lists.at(0)); + mfem::Vector zero_vec(_true_rhs.Size()); + zero_vec = 0.0; + _problem_data.nonlinear_solver->SetSolver(_problem_data.jacobian_solver->getSolver()); _problem_data.nonlinear_solver->SetOperator(*GetEquationSystem()); - _problem_data.nonlinear_solver->Mult(_true_rhs, dX_dt); + + if (!(GetEquationSystem()->_non_linear)) + _problem_data.nonlinear_solver->Mult(_true_rhs, dX_dt); + else + _problem_data.nonlinear_solver->Mult(zero_vec, dX_dt); + + //_problem_data.nonlinear_solver->Mult(zero_vec, dX_dt); SetTrialVariablesFromTrueVectors(); } @@ -77,7 +87,7 @@ void TimeDomainEquationSystemProblemOperator::BuildEquationSystemOperator(mfem::real_t dt) { GetEquationSystem()->SetTimeStep(dt); - GetEquationSystem()->UpdateEquationSystem(); + GetEquationSystem()->UpdateEquationSystem(_problem_data.gridfunctions, _block_true_offsets); GetEquationSystem()->BuildJacobian(_true_x, _true_rhs); } diff --git a/framework/src/mfem/solvers/MFEMHypreGMRES.C b/framework/src/mfem/solvers/MFEMHypreGMRES.C index 70b0c03ccb66..02737d202d78 100644 --- a/framework/src/mfem/solvers/MFEMHypreGMRES.C +++ b/framework/src/mfem/solvers/MFEMHypreGMRES.C @@ -39,8 +39,19 @@ MFEMHypreGMRES::MFEMHypreGMRES(const InputParameters & parameters) : MFEMSolverB void MFEMHypreGMRES::constructSolver(const InputParameters &) { - auto solver = - std::make_unique(getMFEMProblem().mesh().getMFEMParMesh().GetComm()); + // Patch mfem::HypreGMRES to reset preconditioning matrix at every iteration + class HypreGMRESPatched : public mfem::HypreGMRES + { + public: + using mfem::HypreGMRES::HypreGMRES; + void SetOperator(const mfem::Operator & op) + { + mfem::HypreGMRES::SetOperator(op); + HYPRE_GMRESSetPrecondMatrix(HYPRE_Solver(*this), NULL); + } + }; + + auto solver = std::make_unique(getMFEMProblem().getComm()); solver->SetTol(getParam("l_tol")); solver->SetAbsTol(getParam("l_abs_tol")); solver->SetMaxIter(getParam("l_max_its")); diff --git a/framework/src/mfem/solvers/MFEMHyprePCG.C b/framework/src/mfem/solvers/MFEMHyprePCG.C index ea48df63bf8a..fb88dcc15bb5 100644 --- a/framework/src/mfem/solvers/MFEMHyprePCG.C +++ b/framework/src/mfem/solvers/MFEMHyprePCG.C @@ -38,8 +38,19 @@ MFEMHyprePCG::MFEMHyprePCG(const InputParameters & parameters) : MFEMSolverBase( void MFEMHyprePCG::constructSolver(const InputParameters &) { - auto solver = - std::make_unique(getMFEMProblem().mesh().getMFEMParMesh().GetComm()); + // Patch mfem::HyprePCG to reset preconditioning matrix at every iteration + class HyprePCGPatched : public mfem::HyprePCG + { + public: + using mfem::HyprePCG::HyprePCG; + void SetOperator(const mfem::Operator & op) + { + mfem::HyprePCG::SetOperator(op); + HYPRE_PCGSetPrecondMatrix(HYPRE_Solver(*this), NULL); + } + }; + + auto solver = std::make_unique(getMFEMProblem().getComm()); solver->SetTol(getParam("l_tol")); solver->SetAbsTol(getParam("l_abs_tol")); solver->SetMaxIter(getParam("l_max_its")); diff --git a/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000000/data.pvtu b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000000/data.pvtu new file mode 100644 index 000000000000..8efaaa4e6a2e --- /dev/null +++ b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000000/data.pvtu @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000000/proc000000.vtu b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000000/proc000000.vtu new file mode 100644 index 000000000000..449315f29594 --- /dev/null +++ b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000000/proc000000.vtu @@ -0,0 +1,1226 @@ + + + + + +0 0 0 +0.1 0 0 +0 0.1 0 +0.1 0.1 0 +0.1 0 0 +0.2 0 0 +0.1 0.1 0 +0.2 0.1 0 +0.2 0 0 +0.3 0 0 +0.2 0.1 0 +0.3 0.1 0 +0.3 0 0 +0.4 0 0 +0.3 0.1 0 +0.4 0.1 0 +0.4 0 0 +0.5 0 0 +0.4 0.1 0 +0.5 0.1 0 +0.5 0 0 +0.6 0 0 +0.5 0.1 0 +0.6 0.1 0 +0.6 0 0 +0.7 0 0 +0.6 0.1 0 +0.7 0.1 0 +0.7 0 0 +0.8 0 0 +0.7 0.1 0 +0.8 0.1 0 +0.8 0 0 +0.9 0 0 +0.8 0.1 0 +0.9 0.1 0 +0.9 0 0 +1 0 0 +0.9 0.1 0 +1 0.1 0 +0 0.1 0 +0.1 0.1 0 +0 0.2 0 +0.1 0.2 0 +0.1 0.1 0 +0.2 0.1 0 +0.1 0.2 0 +0.2 0.2 0 +0.2 0.1 0 +0.3 0.1 0 +0.2 0.2 0 +0.3 0.2 0 +0.3 0.1 0 +0.4 0.1 0 +0.3 0.2 0 +0.4 0.2 0 +0.4 0.1 0 +0.5 0.1 0 +0.4 0.2 0 +0.5 0.2 0 +0.5 0.1 0 +0.6 0.1 0 +0.5 0.2 0 +0.6 0.2 0 +0.6 0.1 0 +0.7 0.1 0 +0.6 0.2 0 +0.7 0.2 0 +0.7 0.1 0 +0.8 0.1 0 +0.7 0.2 0 +0.8 0.2 0 +0.8 0.1 0 +0.9 0.1 0 +0.8 0.2 0 +0.9 0.2 0 +0.9 0.1 0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0 +0 1 0 +0.1 1 0 +0.1 0.9 0 +0.2 0.9 0 +0.1 1 0 +0.2 1 0 +0.2 0.9 0 +0.3 0.9 0 +0.2 1 0 +0.3 1 0 +0.3 0.9 0 +0.4 0.9 0 +0.3 1 0 +0.4 1 0 +0.4 0.9 0 +0.5 0.9 0 +0.4 1 0 +0.5 1 0 +0.5 0.9 0 +0.6 0.9 0 +0.5 1 0 +0.6 1 0 +0.6 0.9 0 +0.7 0.9 0 +0.6 1 0 +0.7 1 0 +0.7 0.9 0 +0.8 0.9 0 +0.7 1 0 +0.8 1 0 +0.8 0.9 0 +0.9 0.9 0 +0.8 1 0 +0.9 1 0 +0.9 0.9 0 +1 0.9 0 +0.9 1 0 +1 1 0 + + + + +0 1 3 2 +4 5 7 6 +8 9 11 10 +12 13 15 14 +16 17 19 18 +20 21 23 22 +24 25 27 26 +28 29 31 30 +32 33 35 34 +36 37 39 38 +40 41 43 42 +44 45 47 46 +48 49 51 50 +52 53 55 54 +56 57 59 58 +60 61 63 62 +64 65 67 66 +68 69 71 70 +72 73 75 74 +76 77 79 78 +80 81 83 82 +84 85 87 86 +88 89 91 90 +92 93 95 94 +96 97 99 98 +100 101 103 102 +104 105 107 106 +108 109 111 110 +112 113 115 114 +116 117 119 118 +120 121 123 122 +124 125 127 126 +128 129 131 130 +132 133 135 134 +136 137 139 138 +140 141 143 142 +144 145 147 146 +148 149 151 150 +152 153 155 154 +156 157 159 158 +160 161 163 162 +164 165 167 166 +168 169 171 170 +172 173 175 174 +176 177 179 178 +180 181 183 182 +184 185 187 186 +188 189 191 190 +192 193 195 194 +196 197 199 198 +200 201 203 202 +204 205 207 206 +208 209 211 210 +212 213 215 214 +216 217 219 218 +220 221 223 222 +224 225 227 226 +228 229 231 230 +232 233 235 234 +236 237 239 238 +240 241 243 242 +244 245 247 246 +248 249 251 250 +252 253 255 254 +256 257 259 258 +260 261 263 262 +264 265 267 266 +268 269 271 270 +272 273 275 274 +276 277 279 278 +280 281 283 282 +284 285 287 286 +288 289 291 290 +292 293 295 294 +296 297 299 298 +300 301 303 302 +304 305 307 306 +308 309 311 310 +312 313 315 314 +316 317 319 318 +320 321 323 322 +324 325 327 326 +328 329 331 330 +332 333 335 334 +336 337 339 338 +340 341 343 342 +344 345 347 346 +348 349 351 350 +352 353 355 354 +356 357 359 358 +360 361 363 362 +364 365 367 366 +368 369 371 370 +372 373 375 374 +376 377 379 378 +380 381 383 382 +384 385 387 386 +388 389 391 390 +392 393 395 394 +396 397 399 398 + + +4 +8 +12 +16 +20 +24 +28 +32 +36 +40 +44 +48 +52 +56 +60 +64 +68 +72 +76 +80 +84 +88 +92 +96 +100 +104 +108 +112 +116 +120 +124 +128 +132 +136 +140 +144 +148 +152 +156 +160 +164 +168 +172 +176 +180 +184 +188 +192 +196 +200 +204 +208 +212 +216 +220 +224 +228 +232 +236 +240 +244 +248 +252 +256 +260 +264 +268 +272 +276 +280 +284 +288 +292 +296 +300 +304 +308 +312 +316 +320 +324 +328 +332 +336 +340 +344 +348 +352 +356 +360 +364 +368 +372 +376 +380 +384 +388 +392 +396 +400 + + +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 + + + + +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 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em/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000001/data.pvtu new file mode 100644 index 000000000000..8efaaa4e6a2e --- /dev/null +++ b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000001/data.pvtu @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000001/proc000000.vtu b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000001/proc000000.vtu new file mode 100644 index 000000000000..f0b61ea4ec3e --- /dev/null +++ b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Cycle000001/proc000000.vtu @@ -0,0 +1,1226 @@ + + + + + +0 0 0 +0.1 0 0 +0 0.1 0 +0.1 0.1 0 +0.1 0 0 +0.2 0 0 +0.1 0.1 0 +0.2 0.1 0 +0.2 0 0 +0.3 0 0 +0.2 0.1 0 +0.3 0.1 0 +0.3 0 0 +0.4 0 0 +0.3 0.1 0 +0.4 0.1 0 +0.4 0 0 +0.5 0 0 +0.4 0.1 0 +0.5 0.1 0 +0.5 0 0 +0.6 0 0 +0.5 0.1 0 +0.6 0.1 0 +0.6 0 0 +0.7 0 0 +0.6 0.1 0 +0.7 0.1 0 +0.7 0 0 +0.8 0 0 +0.7 0.1 0 +0.8 0.1 0 +0.8 0 0 +0.9 0 0 +0.8 0.1 0 +0.9 0.1 0 +0.9 0 0 +1 0 0 +0.9 0.1 0 +1 0.1 0 +0 0.1 0 +0.1 0.1 0 +0 0.2 0 +0.1 0.2 0 +0.1 0.1 0 +0.2 0.1 0 +0.1 0.2 0 +0.2 0.2 0 +0.2 0.1 0 +0.3 0.1 0 +0.2 0.2 0 +0.3 0.2 0 +0.3 0.1 0 +0.4 0.1 0 +0.3 0.2 0 +0.4 0.2 0 +0.4 0.1 0 +0.5 0.1 0 +0.4 0.2 0 +0.5 0.2 0 +0.5 0.1 0 +0.6 0.1 0 +0.5 0.2 0 +0.6 0.2 0 +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0.8 0 +0.8 0.8 0 +0.7 0.9 0 +0.8 0.9 0 +0.8 0.8 0 +0.9 0.8 0 +0.8 0.9 0 +0.9 0.9 0 +0.9 0.8 0 +1 0.8 0 +0.9 0.9 0 +1 0.9 0 +0 0.9 0 +0.1 0.9 0 +0 1 0 +0.1 1 0 +0.1 0.9 0 +0.2 0.9 0 +0.1 1 0 +0.2 1 0 +0.2 0.9 0 +0.3 0.9 0 +0.2 1 0 +0.3 1 0 +0.3 0.9 0 +0.4 0.9 0 +0.3 1 0 +0.4 1 0 +0.4 0.9 0 +0.5 0.9 0 +0.4 1 0 +0.5 1 0 +0.5 0.9 0 +0.6 0.9 0 +0.5 1 0 +0.6 1 0 +0.6 0.9 0 +0.7 0.9 0 +0.6 1 0 +0.7 1 0 +0.7 0.9 0 +0.8 0.9 0 +0.7 1 0 +0.8 1 0 +0.8 0.9 0 +0.9 0.9 0 +0.8 1 0 +0.9 1 0 +0.9 0.9 0 +1 0.9 0 +0.9 1 0 +1 1 0 + + + + +0 1 3 2 +4 5 7 6 +8 9 11 10 +12 13 15 14 +16 17 19 18 +20 21 23 22 +24 25 27 26 +28 29 31 30 +32 33 35 34 +36 37 39 38 +40 41 43 42 +44 45 47 46 +48 49 51 50 +52 53 55 54 +56 57 59 58 +60 61 63 62 +64 65 67 66 +68 69 71 70 +72 73 75 74 +76 77 79 78 +80 81 83 82 +84 85 87 86 +88 89 91 90 +92 93 95 94 +96 97 99 98 +100 101 103 102 +104 105 107 106 +108 109 111 110 +112 113 115 114 +116 117 119 118 +120 121 123 122 +124 125 127 126 +128 129 131 130 +132 133 135 134 +136 137 139 138 +140 141 143 142 +144 145 147 146 +148 149 151 150 +152 153 155 154 +156 157 159 158 +160 161 163 162 +164 165 167 166 +168 169 171 170 +172 173 175 174 +176 177 179 178 +180 181 183 182 +184 185 187 186 +188 189 191 190 +192 193 195 194 +196 197 199 198 +200 201 203 202 +204 205 207 206 +208 209 211 210 +212 213 215 214 +216 217 219 218 +220 221 223 222 +224 225 227 226 +228 229 231 230 +232 233 235 234 +236 237 239 238 +240 241 243 242 +244 245 247 246 +248 249 251 250 +252 253 255 254 +256 257 259 258 +260 261 263 262 +264 265 267 266 +268 269 271 270 +272 273 275 274 +276 277 279 278 +280 281 283 282 +284 285 287 286 +288 289 291 290 +292 293 295 294 +296 297 299 298 +300 301 303 302 +304 305 307 306 +308 309 311 310 +312 313 315 314 +316 317 319 318 +320 321 323 322 +324 325 327 326 +328 329 331 330 +332 333 335 334 +336 337 339 338 +340 341 343 342 +344 345 347 346 +348 349 351 350 +352 353 355 354 +356 357 359 358 +360 361 363 362 +364 365 367 366 +368 369 371 370 +372 373 375 374 +376 377 379 378 +380 381 383 382 +384 385 387 386 +388 389 391 390 +392 393 395 394 +396 397 399 398 + + +4 +8 +12 +16 +20 +24 +28 +32 +36 +40 +44 +48 +52 +56 +60 +64 +68 +72 +76 +80 +84 +88 +92 +96 +100 +104 +108 +112 +116 +120 +124 +128 +132 +136 +140 +144 +148 +152 +156 +160 +164 +168 +172 +176 +180 +184 +188 +192 +196 +200 +204 +208 +212 +216 +220 +224 +228 +232 +236 +240 +244 +248 +252 +256 +260 +264 +268 +272 +276 +280 +284 +288 +292 +296 +300 +304 +308 +312 +316 +320 +324 +328 +332 +336 +340 +344 +348 +352 +356 +360 +364 +368 +372 +376 +380 +384 +388 +392 +396 +400 + + +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 +9 + + + + +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 + + + + +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1 +1 +1.34164079 +1.34164079 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.34164079 +1.34164079 +1.61245155 +1.61245155 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.61245155 +1.61245155 +1.84390889 +1.84390889 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +1.84390889 +1.84390889 +2.04939015 +2.04939015 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.04939015 +2.04939015 +2.23606798 +2.23606798 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.23606798 +2.23606798 +2.40831892 +2.40831892 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.40831892 +2.40831892 +2.56904652 +2.56904652 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.56904652 +2.56904652 +2.7202941 +2.7202941 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.7202941 +2.7202941 +2.86356421 +2.86356421 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 +2.86356421 +2.86356421 +3 +3 + + + + + diff --git a/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Run0.pvd b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Run0.pvd new file mode 100644 index 000000000000..72ed1b22e1dd --- /dev/null +++ b/test/tests/mfem/kernels/gold/OutputData/NLDiffusion/Run0/Run0.pvd @@ -0,0 +1,7 @@ + + + + + + + diff --git a/test/tests/mfem/kernels/nldiffusion.i b/test/tests/mfem/kernels/nldiffusion.i new file mode 100644 index 000000000000..afccef110ef5 --- /dev/null +++ b/test/tests/mfem/kernels/nldiffusion.i @@ -0,0 +1,115 @@ +[Mesh] + type = MFEMMesh + file = ../mesh/square.e + dim = 2 +[] + +[Problem] + type = MFEMProblem +[] + +[FESpaces] + [H1FESpace] + type = MFEMScalarFESpace + fec_type = H1 + fec_order = FIRST + [] +[] + +[Variables] + [concentration] + type = MFEMVariable + fespace = H1FESpace + [] +[] + + +[ICs] + [diffused_ic] + type = MFEMScalarIC + coefficient = initial + variable = concentration + [] +[] + +[Functions] + [minus] + type = ParsedFunction + expression = -1.0 + [] + [initial] + type = ParsedFunction + expression = 2*y+1 + [] +[] + +[BCs] + [top] + type = MFEMScalarDirichletBC + variable = concentration + boundary = 'top' + coefficient = 3.0 + [] + [bottom] + type = MFEMScalarDirichletBC + variable = concentration + boundary = 'bottom' + coefficient = 1.0 + [] + +[] + + +[Kernels] + [residual] + type = MFEMDomainLFGradKernel + variable = concentration + coefficient = concentration + [] + [jacobian_one] + type = MFEMDiffusionKernel + variable = concentration + coefficient = concentration + [] + [jacobian_two] + type = MFEMMixedScalarWeakDivergenceKernel + variable = concentration + coefficient = minus + [] +[] + +[Preconditioner] + [boomeramg] + type = MFEMHypreBoomerAMG + print_level = 0 + [] + [jacobi] + type = MFEMOperatorJacobiSmoother + [] +[] + +[Solver] + type = MFEMHypreGMRES + preconditioner = boomeramg + print_level = 1 + l_tol = 1e-16 + l_max_its = 1000 +[] + +[Executioner] + type = MFEMSteady + device = cpu + nl_max_its = 100 + nl_abs_tol = 1.0e-10 + nl_rel_tol = 1.0e-9 + print_level = 1 +[] + +[Outputs] + active = ParaViewDataCollection + [ParaViewDataCollection] + type = MFEMParaViewDataCollection + file_base = OutputData/NLDiffusion + vtk_format = ASCII + [] +[] diff --git a/test/tests/mfem/kernels/tests b/test/tests/mfem/kernels/tests index 1a16a2b0009f..6c8005fb9458 100644 --- a/test/tests/mfem/kernels/tests +++ b/test/tests/mfem/kernels/tests @@ -34,6 +34,7 @@ max_threads = 1 platform = 'linux' abs_zero = 1e-6 + max_time = 1000 [] [MFEMDiffusion] type = XMLDiff @@ -250,4 +251,15 @@ compute_devices = 'cpu cuda' recover = false [] + [MFEMNonLinearDiffusion] + type = XMLDiff + input = nldiffusion.i + xmldiff = 'OutputData/NLDiffusion/Run0/Run0.pvd + OutputData/NLDiffusion/Run0/Cycle000001/proc000000.vtu' + requirement = 'The system shall have the ability to solve a non-linear diffusion problem using MFEM.' + capabilities = 'mfem' + compute_devices = 'cpu cuda' + max_parallel = 1 # schemadiff with multiple ranks + recover = false + [] []