https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComplexEquationSystemProblemOperator.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
14namespace Moose::MFEM
15{
16void
18{
21
24
25 // Set operator size and block structure for trial spaces
28 for (const auto ind : index_range(_cmplx_trial_variables))
29 {
31 2 * _cmplx_trial_variables.at(ind)->ParFESpace()->TrueVSize();
32 }
33 _block_true_offsets_trial.PartialSum();
34
35 // Set operator size and block structure for test spaces
38 for (const auto ind : index_range(_cmplx_test_variables))
39 {
41 2 * _cmplx_test_variables.at(ind)->ParFESpace()->TrueVSize();
42 }
43 _block_true_offsets_test.PartialSum();
44
47
50}
51
52void
54{
56
57 auto * const es = GetEquationSystem();
59
60 es->SetTrialVariablesFromTrueVectors(_true_x);
61}
62
63} // namespace Moose::MFEM
64
65#endif
std::vector< mfem::ParComplexGridFunction * > _cmplx_trial_variables
virtual Moose::MFEM::ComplexEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator's equation system.
std::vector< mfem::ParComplexGridFunction * > _cmplx_test_variables
void FormEquationSystemOperator()
Form equation-system state used by Solve().
const std::vector< std::string > & GetTrialVarNames() const
const std::vector< std::string > & GetTestVarNames() const
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.
void SolveWithOperator(mfem::Operator &system_operator, mfem::Operator &linear_operator, const mfem::Vector &rhs, mfem::Vector &x)
Solve the current system operator using the configured nonlinear and linear solvers.
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
std::vector< std::string > _test_var_names
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
Moose::MFEM::ComplexGridFunctions cmplx_gridfunctions