https://mooseframework.inl.gov
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 
14 namespace Moose::MFEM
15 {
16 void
18 {
21 
24 
25  // Set operator size and block structure for trial spaces
28  for (const auto ind : index_range(_cmplx_trial_variables))
29  {
30  _block_true_offsets_trial[ind + 1] =
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  {
40  _block_true_offsets_test[ind + 1] =
41  2 * _cmplx_test_variables.at(ind)->ParFESpace()->TrueVSize();
42  }
43  _block_true_offsets_test.PartialSum();
44 
47 
50 }
51 
52 void
54 {
56 
57  auto * const es = GetEquationSystem();
59 
60  es->SetTrialVariablesFromTrueVectors(_true_x);
61 }
62 
63 } // namespace Moose::MFEM
64 
65 #endif
virtual Moose::MFEM::ComplexEquationSystem * GetEquationSystem() const override
Returns a pointer to the operator's equation system.
std::vector< std::string > _test_var_names
Moose::MFEM::ComplexGridFunctions cmplx_gridfunctions
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
mfem::Array< int > _block_true_offsets_test
mfem::Array< int > _block_true_offsets_trial
std::vector< mfem::ParComplexGridFunction * > _cmplx_test_variables
std::vector< mfem::ParComplexGridFunction * > _cmplx_trial_variables
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...
const std::vector< std::string > & GetTrialVarNames() const
void SolveWithOperator(EquationSystem &equation_system, const mfem::Vector &rhs, mfem::Vector &x)
Solve the current equation system/operator using the configured nonlinear solver or linear solver for...
const std::vector< std::string > & GetTestVarNames() const
void BuildEquationSystemOperator()
Add kernels/bcs and assemble the linear part of the equation system.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
auto index_range(const T &sizable)