https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ProblemOperatorBase.h
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
12#pragma once
13
14#include "MFEMProblem.h"
15#include <functional>
16
17namespace Moose::MFEM
18{
19
53{
54public:
56 virtual ~ProblemOperatorBase() = default;
57
58 virtual void SetGridFunctions();
60 virtual void Init(mfem::BlockVector & X);
61 virtual void Solve() = 0;
62
63 mfem::Array<int> _block_true_offsets_test;
64 mfem::Array<int> _block_true_offsets_trial;
65
66 mfem::BlockVector _true_x, _true_rhs;
67
68protected:
70 void SolveWithOperator(mfem::Operator & system_operator,
71 mfem::Operator & linear_operator,
72 const mfem::Vector & rhs,
73 mfem::Vector & x);
74
76 void
77 SolveWithOperator(mfem::Operator & system_operator, const mfem::Vector & rhs, mfem::Vector & x)
78 {
79 return SolveWithOperator(system_operator, system_operator.GetGradient(x), rhs, x);
80 }
81
85
88 std::vector<std::string> _trial_var_names;
89 std::vector<std::string> _test_var_names;
90 std::vector<mfem::ParGridFunction *> _trial_variables;
91 std::vector<mfem::ParGridFunction *> _test_variables;
92 mfem::Vector * _trial_true_vector = nullptr;
93};
94}
95
96#endif
Connects MFEMProblem's MOOSE solver objects to EquationSystem's mathematics.
std::vector< mfem::ParGridFunction * > _trial_variables
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.
virtual void Init(mfem::BlockVector &X)
MFEMProblem & _problem
Reference to the current problem.
std::vector< mfem::ParGridFunction * > _test_variables
std::vector< std::string > _trial_var_names
Vector of names of state gridfunctions used in formulation, ordered by appearance in block vector dur...
virtual ~ProblemOperatorBase()=default
std::vector< std::string > _test_var_names
void SolveWithOperator(mfem::Operator &system_operator, const mfem::Vector &rhs, mfem::Vector &x)
Solve the current system operator using system_operator.GetGradient(x) as the linear operator.
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
Base problem data struct.