template<class LinearSystem>
ProblemBase class
Base class for variational problem objects.
Template parameters | |
---|---|
LinearSystem | Type of linear system (e.g., sparse or dense) |
Abstract base class for variational problems.
This class provides the foundation for defining and solving variational problems in finite element analysis. It encapsulates the discrete linear system arising from the weak formulation of PDEs and provides a unified interface for assembly and solution operations.
Usage Example
// Define a problem and solve auto problem = Problem(trialSpace, testSpace); problem = bilinearForm == linearForm; problem.assemble(); problem.solve(solver);
Base classes
- class Base
- Base class for all objects in Rodin's FormLanguage system.
Derived classes
-
template<class LinearSystem, class U, class V>class ProblemUVBase
- General class to assemble linear systems with
Operator
andVector
generic types in a sequential context. -
template<class LinearSystem, class U, class V>class ProblemUVBase
- General class to assemble linear systems with
Operator
andVector
generic types in a sequential context. -
template<class LinearSystem, class U, class V>class ProblemUVBase
- General class to assemble linear systems with
Operator
andVector
generic types in a sequential context.
Public types
-
using OperatorType = typename FormLanguage::
Traits<LinearSystem>::OperatorType - Matrix operator type from linear system traits.
-
using VectorType = typename FormLanguage::
Traits<LinearSystem>::VectorType - Vector type from linear system traits.
-
using ScalarType = typename FormLanguage::
Traits<LinearSystem>::ScalarType - Scalar type from linear system traits
- using ProblemBodyType = ProblemBody<OperatorType, VectorType, ScalarType>
- Problem body type containing bilinear and linear forms.
Constructors, destructors, conversion operators
- ProblemBase() defaulted
- Default constructor.
- ProblemBase(ProblemBase&& other) defaulted
- Move constructor.
- ProblemBase(const ProblemBase& other) defaulted
- Copy constructor.
Public functions
- auto operator=(const ProblemBodyType& rhs) -> ProblemBase& pure virtual
- Assigns a problem body to this problem.
-
void solve(Solver::
SolverBase<LinearSystem>& solver) pure virtual - Solves the assembled linear system.
- auto assemble() -> ProblemBase& pure virtual
- Assembles the underlying linear system to solve.
- auto getLinearSystem() -> LinearSystem& pure virtual
- Gets the assembled linear system.
- auto getLinearSystem() const -> const LinearSystem& pure virtual
- Gets the assembled linear system (const version).
- auto copy() const -> ProblemBase* override noexcept
- Creates a polymorphic copy of this problem.
Function documentation
template<class LinearSystem>
ProblemBase& Rodin:: Variational:: ProblemBase<LinearSystem>:: operator=(const ProblemBodyType& rhs) pure virtual
Assigns a problem body to this problem.
Parameters | |
---|---|
rhs | Problem body containing bilinear and linear forms |
Returns | Reference to this problem instance |
This operator allows setting up the variational problem by assigning a problem body that contains the bilinear form and linear form defining the weak formulation.
template<class LinearSystem>
void Rodin:: Variational:: ProblemBase<LinearSystem>:: solve(Solver:: SolverBase<LinearSystem>& solver) pure virtual
Solves the assembled linear system.
Parameters | |
---|---|
solver | Solver instance to use for solving the linear system |
Solves the discrete system using the provided solver. The problem must be assembled before calling this method.
template<class LinearSystem>
ProblemBase& Rodin:: Variational:: ProblemBase<LinearSystem>:: assemble() pure virtual
Assembles the underlying linear system to solve.
Returns | Reference to this problem instance for method chaining |
---|
Assembles the bilinear form into the system matrix and the linear form into the right-hand side vector , creating the discrete linear system .
template<class LinearSystem>
LinearSystem& Rodin:: Variational:: ProblemBase<LinearSystem>:: getLinearSystem() pure virtual
Gets the assembled linear system.
Returns | Reference to the linear system |
---|
template<class LinearSystem>
const LinearSystem& Rodin:: Variational:: ProblemBase<LinearSystem>:: getLinearSystem() const pure virtual
Gets the assembled linear system (const version).
Returns | Const reference to the linear system |
---|
template<class LinearSystem>
ProblemBase* Rodin:: Variational:: ProblemBase<LinearSystem>:: copy() const override noexcept
Creates a polymorphic copy of this problem.
Returns | Pointer to a new copy of this problem |
---|