https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComplexEquationSystem.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#ifdef MOOSE_MFEM_ENABLED
11
13#include "CoefficientManager.h"
14#include "libmesh/int_range.h"
15
16namespace Moose::MFEM
17{
18
19void
21 ComplexGridFunctions & cmplx_gridfunctions,
22 mfem::AssemblyLevel assembly_level)
23{
24 _assembly_level = assembly_level;
25
26 if (gridfunctions.size())
27 mooseError("Mixing real and complex variables is currently not supported.");
28
29 for (auto & test_var_name : _test_var_names)
30 {
31 if (!cmplx_gridfunctions.Has(test_var_name))
32 {
33 mooseError("MFEM complex variable ",
34 test_var_name,
35 " requested by equation system during initialization was "
36 "not found in gridfunctions");
37 }
38 // Store pointers to test FESpaces
39 _test_pfespaces.push_back(cmplx_gridfunctions.Get(test_var_name)->ParFESpace());
40 // Create auxiliary gridfunctions for storing essential constraints from Dirichlet conditions
41 _cmplx_var_ess_constraints.emplace_back(std::make_unique<mfem::ParComplexGridFunction>(
42 cmplx_gridfunctions.Get(test_var_name)->ParFESpace()));
43 }
44
45 // Store pointers to FESpaces of all coupled variables
46 for (auto & coupled_var_name : _coupled_var_names)
47 _coupled_pfespaces.push_back(cmplx_gridfunctions.Get(coupled_var_name)->ParFESpace());
48
49 // Extract which coupled variables are to be trivially eliminated and which are trial variables
53
54 // Store pointers to coupled variable ComplexGridFunctions that are to be eliminated prior to
55 // forming the jacobian
56 for (auto & eliminated_var_name : _eliminated_var_names)
57 _cmplx_eliminated_variables.Register(eliminated_var_name,
58 cmplx_gridfunctions.GetShared(eliminated_var_name));
59
60 // Get a reference to the complex GridFunctions
61 _complex_gfuncs = &cmplx_gridfunctions;
62}
63
64void
66{
67 // Register linear forms
68 for (const auto i : index_range(_test_var_names))
69 {
70 auto test_var_name = _test_var_names.at(i);
71 _clfs.Register(test_var_name,
72 std::make_shared<mfem::ParComplexLinearForm>(_test_pfespaces.at(i)));
73 _clfs.GetRef(test_var_name) = 0.0;
74 }
75
76 for (auto & test_var_name : _test_var_names)
77 {
78 // Apply kernels
79 auto clf = _clfs.GetShared(test_var_name);
82 clf->Assemble();
83 }
84
85 // Apply essential constraints on strongly constrained DoFs
87
88 // Eliminate trivially eliminated variables by subtracting contributions from linear forms
90}
91
92void
94{
95 // Register bilinear forms
96 for (const auto i : index_range(_test_var_names))
97 {
98 auto test_var_name = _test_var_names.at(i);
99 _slfs.Register(test_var_name,
100 std::make_shared<mfem::ParSesquilinearForm>(_test_pfespaces.at(i)));
101
102 // Apply kernels
103 auto slf = _slfs.GetShared(test_var_name);
104 slf->SetAssemblyLevel(_assembly_level);
105 ApplyBoundaryBLFIntegrators<mfem::ParSesquilinearForm>(
106 test_var_name, test_var_name, slf, _cmplx_integrated_bc_map);
107 ApplyDomainBLFIntegrators<mfem::ParSesquilinearForm>(
108 test_var_name, test_var_name, slf, _cmplx_kernels_map);
109 // Assemble
110 slf->Assemble();
111 slf->Finalize();
112 }
113}
114
115void
117{
118 // Register mixed sesquilinear forms. Note that not all combinations may
119 // have a kernel.
120
121 // Create mslf for each test/coupled variable pair with an added kernel.
122 // Mixed sesquilinear forms with coupled variables that are not trial variables are
123 // associated with contributions from eliminated variables.
124 for (const auto i : index_range(_test_var_names))
125 {
126 auto test_var_name = _test_var_names.at(i);
127 auto test_mslfs =
128 std::make_shared<Moose::MFEM::NamedFieldsMap<mfem::ParMixedSesquilinearForm>>();
129 for (const auto j : index_range(_coupled_var_names))
130 {
131 const auto & coupled_var_name = _coupled_var_names.at(j);
132 auto mslf = std::make_shared<mfem::ParMixedSesquilinearForm>(_coupled_pfespaces.at(j),
133 _test_pfespaces.at(i));
134 // Register MixedSesquilinearForm if kernels exist for it, and assemble
135 // kernels
136 if (_cmplx_kernels_map.Has(test_var_name) &&
137 _cmplx_kernels_map.Get(test_var_name)->Has(coupled_var_name) &&
138 test_var_name != coupled_var_name)
139 {
140 mslf->SetAssemblyLevel(_assembly_level);
141 // Apply all mixed kernels with this test/trial pair
142 ApplyDomainBLFIntegrators<mfem::ParMixedSesquilinearForm>(
143 coupled_var_name, test_var_name, mslf, _cmplx_kernels_map);
144 // Assemble mixed bilinear forms
145 mslf->Assemble();
146 mslf->Finalize();
147 // Register mixed bilinear forms associated with a single trial variable
148 // for the current test variable
149 test_mslfs->Register(coupled_var_name, mslf);
150 }
151 }
152 // Register all mixed bilinear form sets associated with a single test
153 // variable
154 _mslfs.Register(test_var_name, test_mslfs);
155 }
156}
157
158void
160 mfem::ParComplexGridFunction & trial_gf,
161 mfem::Array<int> & global_bdr_markers,
162 mfem::Array<int> & global_ess_tdofs)
163{
164 // A mesh without boundary elements, such as a periodic one, has no boundary attributes
165 const auto & bdr_attributes = trial_gf.ParFESpace()->GetParMesh()->bdr_attributes;
166 global_bdr_markers.SetSize(bdr_attributes.Size() ? bdr_attributes.Max() : 0, 0);
167 global_ess_tdofs.SetSize(0);
168 if (_cmplx_essential_bc_map.Has(var_name))
169 for (auto & bc : _cmplx_essential_bc_map.GetRef(var_name))
170 {
171 // Set constrained DoFs values on essential boundaries
172 bc->ApplyBC(trial_gf);
173 // Fetch marker array labelling essential boundaries of current BC
174 mfem::Array<int> ess_bdrs(bc->getBoundaryMarkers());
175 // Add these boundary markers to the set of markers labelling all essential boundaries
176 for (const auto i : make_range(ess_bdrs.Size()))
177 global_bdr_markers[i] |= ess_bdrs[i];
178
179 // Append to the global list so we can detect duplicate essential true DoFs below
180 mfem::Array<int> ess_tdofs;
181 trial_gf.ParFESpace()->GetEssentialTrueDofs(ess_bdrs, ess_tdofs);
182 global_ess_tdofs.Append(ess_tdofs);
183 }
184
185 // Set constrained DoF values and append the constrained tdofs. The constraints on a variable act
186 // on disjoint sets of subdomains and we error below if any one DoF is constrained more than once,
187 // so they may be applied in any order.
189 for (auto & constraint : _cmplx_essential_constraint_map.GetRef(var_name))
190 constraint->ApplyConstraint(trial_gf, global_ess_tdofs);
191
192 // We do not allow users to constrain the same DoFs more than once.
193 // mfem::Array::Unique only drops *consecutive* duplicates, so the list must be sorted first.
194 const int num_ess_tdofs = global_ess_tdofs.Size();
195 global_ess_tdofs.Sort();
196 global_ess_tdofs.Unique();
197 if (global_ess_tdofs.Size() != num_ess_tdofs)
198 mooseError("Duplicate essential true degrees of freedom for variable '",
199 var_name,
200 "'. Check for overlapping essential constraints or boundary conditions.");
201}
202
203void
205{
206 _ess_tdof_lists.resize(_trial_var_names.size());
207 _ess_bdr_markers.resize(_trial_var_names.size());
208 for (const auto i : index_range(_trial_var_names))
209 {
210 const auto & trial_var_name = _trial_var_names.at(i);
211 mfem::ParComplexGridFunction & trial_gf = *_cmplx_var_ess_constraints.at(i);
212
213 // Make sure we update the size, if this mesh has changed recently for instance
214 trial_gf.Update();
215
216 // Initial guess for iterative solvers (initial condition or the previous time step solution)
217 cast_ref<mfem::Vector &>(trial_gf) = _complex_gfuncs->GetRef(trial_var_name);
218
219 // Set strongly constrained DoFs of trial_gf and set essential bdr markers
221 trial_var_name, trial_gf, _ess_bdr_markers.at(i), _ess_tdof_lists.at(i));
222 }
223}
224
225void
226ComplexEquationSystem::AddComplexKernel(std::shared_ptr<MFEMComplexKernel> kernel)
227{
228 const auto & trial_var_name = kernel->getTrialVariableName();
229 const auto & test_var_name = kernel->getTestVariableName();
230 AddCoupledVariableNameIfMissing(trial_var_name);
231 AddTestVariableNameIfMissing(test_var_name);
232 // Register new complex kernels map if not present for the test variable
233 if (!_cmplx_kernels_map.Has(test_var_name))
234 {
235 auto kernel_field_map =
236 std::make_shared<NamedFieldsMap<std::vector<std::shared_ptr<MFEMComplexKernel>>>>();
237 _cmplx_kernels_map.Register(test_var_name, std::move(kernel_field_map));
238 }
239 // Register new complex kernels map if not present for the test/trial variable pair
240 if (!_cmplx_kernels_map.Get(test_var_name)->Has(trial_var_name))
241 {
242 auto kernels = std::make_shared<std::vector<std::shared_ptr<MFEMComplexKernel>>>();
243 _cmplx_kernels_map.Get(test_var_name)->Register(trial_var_name, std::move(kernels));
244 }
245 _cmplx_kernels_map.GetRef(test_var_name).Get(trial_var_name)->push_back(std::move(kernel));
246}
247
248void
249ComplexEquationSystem::AddComplexIntegratedBC(std::shared_ptr<MFEMComplexIntegratedBC> bc)
250{
251 const auto & trial_var_name = bc->getTrialVariableName();
252 const auto & test_var_name = bc->getTestVariableName();
253 AddCoupledVariableNameIfMissing(trial_var_name);
254 AddTestVariableNameIfMissing(test_var_name);
255 // Register new complex integrated bc map if not present for the test variable
256 if (!_cmplx_integrated_bc_map.Has(test_var_name))
257 {
258 auto integrated_bc_field_map =
259 std::make_shared<NamedFieldsMap<std::vector<std::shared_ptr<MFEMComplexIntegratedBC>>>>();
260 _cmplx_integrated_bc_map.Register(test_var_name, std::move(integrated_bc_field_map));
261 }
262 // Register new complex integrated bc map if not present for the test/trial variable pair
263 if (!_cmplx_integrated_bc_map.Get(test_var_name)->Has(trial_var_name))
264 {
265 auto bcs = std::make_shared<std::vector<std::shared_ptr<MFEMComplexIntegratedBC>>>();
266 _cmplx_integrated_bc_map.Get(test_var_name)->Register(trial_var_name, std::move(bcs));
267 }
268 _cmplx_integrated_bc_map.GetRef(test_var_name).Get(trial_var_name)->push_back(std::move(bc));
269}
270
271void
272ComplexEquationSystem::AddComplexEssentialBCs(std::shared_ptr<MFEMComplexEssentialBC> bc)
273{
274 // Essential BCs act on a trial gridfunction and are applied while iterating the
275 // trial variables, so they are keyed by trial variable name. The variable's
276 // equation is established by its kernels; a BC does not create one, and Init
277 // checks that one exists.
278 const auto & trial_var_name = bc->getTrialVariableName();
279 // Register new complex essential bc map if not present for the trial variable
280 if (!_cmplx_essential_bc_map.Has(trial_var_name))
281 {
282 auto bcs = std::make_shared<std::vector<std::shared_ptr<MFEMComplexEssentialBC>>>();
283 _cmplx_essential_bc_map.Register(trial_var_name, std::move(bcs));
284 }
285 _cmplx_essential_bc_map.GetRef(trial_var_name).push_back(std::move(bc));
286}
287
288void
290 std::shared_ptr<MFEMComplexEssentialConstraint> constraint)
291{
292 const auto & trial_var_name = constraint->getTrialVariableName();
293 // Register new complex essential constraint map if not present for the trial variable
294 if (!_cmplx_essential_constraint_map.Has(trial_var_name))
295 {
296 auto constraints =
297 std::make_shared<std::vector<std::shared_ptr<MFEMComplexEssentialConstraint>>>();
298 _cmplx_essential_constraint_map.Register(trial_var_name, std::move(constraints));
299 }
300 auto & constraints = _cmplx_essential_constraint_map.GetRef(trial_var_name);
301 for (const auto & other : constraints)
302 constraint->checkDisjointSubdomains(*other);
303 constraints.push_back(std::move(constraint));
304}
305
306bool
307ComplexEquationSystem::HasEssentialConstraints(const std::string & var_name) const
308{
309 return _cmplx_essential_constraint_map.Has(var_name);
310}
311
312void
314{
315 for (const auto & test_var_name : _test_var_names)
316 for (const auto & eliminated_var_name : _eliminated_var_names)
317 if (_mslfs.Has(test_var_name) && _mslfs.Get(test_var_name)->Has(eliminated_var_name) &&
318 !VectorContainsName(_test_var_names, eliminated_var_name))
319 {
320 auto & mslf = *_mslfs.Get(test_var_name)->Get(eliminated_var_name);
321 auto & clf = *_clfs.Get(test_var_name);
322 const mfem::real_t scale = -1.0;
323 const mfem::real_t conv =
324 (mslf.GetConvention() == mfem::ComplexOperator::HERMITIAN) ? 1.0 : -1.0;
325
326 // y += scale * (A_r + i * A_i) * (x_r + i * x_i)
327 // and take the complex conjugate of the result if convention is BLOCK_SYMMETRIC
328 mslf.real().AddMult(
329 _cmplx_eliminated_variables.Get(eliminated_var_name)->real(), clf.real(), scale);
330 mslf.real().AddMult(
331 _cmplx_eliminated_variables.Get(eliminated_var_name)->imag(), clf.imag(), conv * scale);
332 mslf.imag().AddMult(
333 _cmplx_eliminated_variables.Get(eliminated_var_name)->imag(), clf.real(), -scale);
334 mslf.imag().AddMult(
335 _cmplx_eliminated_variables.Get(eliminated_var_name)->real(), clf.imag(), conv * scale);
336 clf.SyncAlias();
337 }
338}
339
340void
342 mfem::BlockVector & trueX,
343 mfem::BlockVector & trueRHS)
344{
345 auto & test_var_name = _test_var_names.at(0);
346 mfem::Vector aux_x, aux_rhs;
347 mfem::OperatorPtr aux_a;
348
349 auto slf = _slfs.Get(test_var_name);
350 slf->FormLinearSystem(_ess_tdof_lists.at(0),
352 *_clfs.Get(test_var_name),
353 aux_a,
354 aux_x,
355 aux_rhs,
356 /*copy_interior=*/true);
357
358 trueX.GetBlock(0) = aux_x;
359 trueRHS.GetBlock(0) = aux_rhs;
360 trueX.SyncFromBlocks();
361 trueRHS.SyncFromBlocks();
362
363 op.Reset(aux_a.Ptr());
364 aux_a.SetOperatorOwner(false);
365}
366
367void
369 mfem::BlockVector & trueX,
370 mfem::BlockVector & trueRHS)
371{
372 // Allocate block operator
374 _h_blocks.SetSize(_test_var_names.size(), _trial_var_names.size());
375 _h_blocks = nullptr;
376 // Zero out RHS and sync memory
377 trueRHS = 0.0;
378 trueRHS.SyncToBlocks();
379
380 for (const auto i : index_range(_test_var_names))
381 {
382 auto test_var_name = _test_var_names.at(i);
383
384 for (const auto j : index_range(_trial_var_names))
385 {
386 auto trial_var_name = _trial_var_names.at(j);
387
388 mfem::Vector aux_x, aux_rhs;
389 mfem::ParComplexLinearForm aux_lf(_test_pfespaces.at(i));
390 std::unique_ptr<mfem::OperatorHandle> aux_a = std::make_unique<mfem::OperatorHandle>();
391
392 if (test_var_name == trial_var_name)
393 {
394 mooseAssert(i == j, "Trial and test variables must have the same ordering.");
395 auto slf = _slfs.Get(test_var_name);
396 slf->FormLinearSystem(_ess_tdof_lists.at(j),
398 *_clfs.Get(test_var_name),
399 *aux_a,
400 aux_x,
401 aux_rhs,
402 /*copy_interior=*/true);
403 trueX.GetBlock(i) = aux_x;
404 }
405 else if (_mslfs.Has(test_var_name) && _mslfs.Get(test_var_name)->Has(trial_var_name))
406 {
407 auto mslf = _mslfs.Get(test_var_name)->Get(trial_var_name);
408 mslf->FormRectangularLinearSystem(_ess_tdof_lists.at(j),
409 _ess_tdof_lists.at(i),
411 aux_lf = 0.,
412 *aux_a,
413 aux_x,
414 aux_rhs);
415 }
416 else
417 continue;
418
419 trueRHS.GetBlock(i) += aux_rhs;
420 _h_blocks(i, j) = aux_a->As<mfem::ComplexHypreParMatrix>()->GetSystemMatrix();
421 }
422 }
423
424 // Sync memory
425 trueX.SyncFromBlocks();
426 trueRHS.SyncFromBlocks();
427
428 // Create monolithic matrix
429 op.Reset(mfem::HypreParMatrixFromBlocks(_h_blocks));
430}
431
432// Equation system Mult
433void
434ComplexEquationSystem::Mult(const mfem::Vector & x, mfem::Vector & residual) const
435{
436 _linear_operator->Mult(x, residual);
437 x.HostRead();
438 residual.HostRead();
439}
440
441void
443{
444 for (const auto i : index_range(_trial_var_names))
445 {
446 auto & trial_var_name = _trial_var_names.at(i);
447 trueX.GetBlock(i).SyncMemory(trueX);
448 _complex_gfuncs->Get(trial_var_name)->Distribute(&(trueX.GetBlock(i)));
449 }
450 // Solution variables changed: stored projections of solution-dependent coefficients are stale.
453}
454}
455
456#endif
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
Real scale
Definition MortarUtils.C:62
void markSolutionChanged()
Notify quadrature function coefficients that solution variables have changed, marking the stored valu...
NamedFieldsMap< std::vector< std::shared_ptr< MFEMComplexEssentialConstraint > > > _cmplx_essential_constraint_map
virtual void ApplyComplexEssentialConstraint(const std::string &var_name, mfem::ParComplexGridFunction &trial_gf, mfem::Array< int > &global_bdr_markers, mfem::Array< int > &global_ess_tdofs)
Apply essential constraints associated with var_name to set true DoFs of trial_gf,...
bool HasEssentialConstraints(const std::string &var_name) const override
void EliminateCoupledVariables() override
Perform trivial eliminations of coupled variables lacking corresponding test variables.
virtual void BuildLinearForms() override
Build linear forms and eliminate constrained DoFs.
std::vector< std::unique_ptr< mfem::ParComplexGridFunction > > _cmplx_var_ess_constraints
Complex Gridfunctions holding essential constraints from Dirichlet BCs.
Moose::MFEM::ComplexGridFunctions * _complex_gfuncs
NamedFieldsMap< NamedFieldsMap< std::vector< std::shared_ptr< MFEMComplexKernel > > > > _cmplx_kernels_map
virtual void Mult(const mfem::Vector &x, mfem::Vector &y) const override
Nonlinear Mult (Used by Newton-solver not necessarily nonlinear)
virtual void FormSystemOperator(mfem::OperatorHandle &op, mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) override
Form matrix-free representation of system operator.
virtual void BuildMixedBilinearForms() override
Build mixed bilinear forms (off-diagonal Jacobian contributions)
virtual void SetTrialVariablesFromTrueVectors(const mfem::BlockVector &trueX) const override
Update variable from solution vector after solve.
NamedFieldsMap< std::vector< std::shared_ptr< MFEMComplexEssentialBC > > > _cmplx_essential_bc_map
NamedFieldsMap< mfem::ParSesquilinearForm > _slfs
virtual void BuildBilinearForms() override
Build bilinear forms (diagonal Jacobian contributions)
virtual void Init(GridFunctions &gridfunctions, ComplexGridFunctions &cmplx_gridfunctions, mfem::AssemblyLevel assembly_level) override
Initialise.
void ApplyBoundaryLFIntegrators(const std::string &test_var_name, std::shared_ptr< mfem::ParComplexLinearForm > form, NamedFieldsMap< NamedFieldsMap< std::vector< std::shared_ptr< MFEMComplexIntegratedBC > > > > &integrated_bc_map)
Method for applying LinearFormIntegrators on boundaries from kernels to a ParComplexLinearForm.
void AddComplexKernel(std::shared_ptr< MFEMComplexKernel > kernel)
Add complex kernels.
void AddComplexEssentialConstraint(std::shared_ptr< MFEMComplexEssentialConstraint > constraint)
Add complex essential (volumetric) constraints.
NamedFieldsMap< NamedFieldsMap< std::vector< std::shared_ptr< MFEMComplexIntegratedBC > > > > _cmplx_integrated_bc_map
virtual void ApplyEssentialConstraints() override
Update essential boundary markers and all constrained true DoF lists and values.
void ApplyDomainLFIntegrators(const std::string &test_var_name, std::shared_ptr< mfem::ParComplexLinearForm > form, NamedFieldsMap< NamedFieldsMap< std::vector< std::shared_ptr< MFEMComplexKernel > > > > &kernels_map)
Method for applying LinearFormIntegrators on domains from kernels to a ParComplexLinearForm.
NamedFieldsMap< mfem::ParComplexLinearForm > _clfs
NamedFieldsMap< NamedFieldsMap< mfem::ParMixedSesquilinearForm > > _mslfs
virtual void FormSystemMatrix(mfem::OperatorHandle &op, mfem::BlockVector &trueX, mfem::BlockVector &trueRHS) override
Form matrix representation of system operator as a HypreParMatrix.
void AddComplexIntegratedBC(std::shared_ptr< MFEMComplexIntegratedBC > bc)
Add complex integrated BCs.
ComplexGridFunctions _cmplx_eliminated_variables
Pointers to coupled variables not part of the reduced ComplexEquationSystem.
void AddComplexEssentialBCs(std::shared_ptr< MFEMComplexEssentialBC > bc)
Add complex essential BCs.
void CheckConstrainedVariablesAreTrialVariables(const Moose::MFEM::NamedFieldsMap< std::vector< std::shared_ptr< T > > > &map) const
Error if any variable that map holds strongly constrained DoFs for is not a trial variable of this sy...
virtual void AddTestVariableNameIfMissing(const std::string &test_var_name)
Add test variable to EquationSystem.
std::vector< std::string > _coupled_var_names
Names of all trial variables of kernels and boundary conditions added to this EquationSystem.
std::vector< mfem::ParFiniteElementSpace * > _test_pfespaces
Pointers to finite element spaces associated with test variables.
std::vector< mfem::Array< int > > _ess_bdr_markers
std::vector< mfem::ParFiniteElementSpace * > _coupled_pfespaces
Pointers to finite element spaces associated with coupled variables.
bool VectorContainsName(const std::vector< std::string > &the_vector, const std::string &name) const
mfem::Array2D< const mfem::HypreParMatrix * > _h_blocks
std::vector< std::string > _test_var_names
Names of all test variables corresponding to linear forms in this equation system.
mfem::OperatorHandle _linear_operator
mfem::AssemblyLevel _assembly_level
virtual void SetTrialVariableNames()
Set trial variable names from subset of coupled variables that have an associated test variable.
std::vector< mfem::Array< int > > _ess_tdof_lists
CoefficientManager * _coefficient_manager
void DeleteHBlocks()
Deletes the HypreParMatrix associated with any pointer stored in _h_blocks, and then proceeds to dele...
std::vector< std::string > _trial_var_names
Subset of _coupled_var_names of all variables corresponding to gridfunctions with degrees of freedom ...
std::vector< std::string > _eliminated_var_names
Names of all coupled variables without a corresponding test variable.
virtual void AddCoupledVariableNameIfMissing(const std::string &coupled_var_name)
Add coupled variable to EquationSystem.
void Register(const std::string &field_name, FieldArgs &&... args)
Construct new field with name field_name and register.
bool Has(const std::string &field_name) const
Predicate to check if a field is registered with name field_name.
T * Get(const std::string &field_name) const
Returns a non-owning pointer to the field. This is guaranteed to return a non-null pointer.
std::shared_ptr< T > GetShared(const std::string &field_name) const
Returns a shared pointer to the field. This is guaranteed to return a non-null shared pointer.
int size() const
Returns the number of elements in the map.
T & GetRef(const std::string &field_name) const
Returns a reference to a field.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).