OGS
|
Assembles the Jacobian matrix using central differences.
Definition at line 25 of file CentralDifferencesJacobianAssembler.h.
#include <CentralDifferencesJacobianAssembler.h>
Public Member Functions | |
CentralDifferencesJacobianAssembler (std::vector< double > &&absolute_epsilons) | |
void | assembleWithJacobian (LocalAssemblerInterface &local_assembler, double const t, double const dt, std::vector< double > const &local_x_data, std::vector< double > const &local_x_prev_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override |
std::unique_ptr< AbstractJacobianAssembler > | copy () const override |
Public Member Functions inherited from ProcessLib::AbstractJacobianAssembler | |
virtual void | assembleWithJacobianForStaggeredScheme (LocalAssemblerInterface &, double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &, int const, std::vector< double > &, std::vector< double > &) |
virtual | ~AbstractJacobianAssembler ()=default |
Private Attributes | |
std::vector< double > const | _absolute_epsilons |
std::vector< double > | _local_M_data |
std::vector< double > | _local_K_data |
std::vector< double > | _local_b_data |
std::vector< double > | _local_x_perturbed_data |
|
explicit |
Constructs a new instance.
absolute_epsilons | perturbations of the components of the local solution vector used for evaluating the finite differences. |
absolute_epsilons
defines the "number of
components" of the local solution vector (This is not the number of elements of the vector!). Therefore the size of the local solution vector must be divisible by the size of absolute_epsilons
. This is the only consistency check performed. It is not checked whether said "number of components" is sensible. E.g., one could pass one epsilon per node, which would be valid but would not make sense at all. Definition at line 20 of file CentralDifferencesJacobianAssembler.cpp.
References _absolute_epsilons.
|
overridevirtual |
Assembles the Jacobian, the matrices \(M\) and \(K\), and the vector \(b\). For the assembly the assemble() method of the given local_assembler
is called several times and the Jacobian is built from finite differences. The number of calls of the assemble() method is \(2N+1\) if \(N\) is the size of local_x_data
.
Implements ProcessLib::AbstractJacobianAssembler.
Definition at line 30 of file CentralDifferencesJacobianAssembler.cpp.
References _absolute_epsilons, _local_b_data, _local_K_data, _local_M_data, _local_x_perturbed_data, ProcessLib::LocalAssemblerInterface::assemble(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), OGS_FATAL, MathLib::toMatrix(), and MathLib::toVector().
|
overridevirtual |
Implements ProcessLib::AbstractJacobianAssembler.
Definition at line 222 of file CentralDifferencesJacobianAssembler.cpp.
|
private |
Definition at line 64 of file CentralDifferencesJacobianAssembler.h.
Referenced by CentralDifferencesJacobianAssembler(), and assembleWithJacobian().
|
private |
Definition at line 70 of file CentralDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().
|
private |
Definition at line 69 of file CentralDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().
|
private |
Definition at line 68 of file CentralDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().
|
private |
Definition at line 71 of file CentralDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().