OGS
|
Assembles the Jacobian matrix using forward differences.
Definition at line 17 of file ForwardDifferencesJacobianAssembler.h.
#include <ForwardDifferencesJacobianAssembler.h>
Public Member Functions | |
ForwardDifferencesJacobianAssembler (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 18 of file ForwardDifferencesJacobianAssembler.cpp.
References _absolute_epsilons, and OGS_FATAL.
|
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
.
Implements ProcessLib::AbstractJacobianAssembler.
Definition at line 28 of file ForwardDifferencesJacobianAssembler.cpp.
References _absolute_epsilons, _local_b_data, _local_K_data, _local_M_data, _local_x_perturbed_data, ProcessLib::LocalAssemblerInterface::assemble(), MathLib::createZeroedMatrix(), OGS_FATAL, and MathLib::toMatrix().
|
overridevirtual |
Implements ProcessLib::AbstractJacobianAssembler.
Definition at line 152 of file ForwardDifferencesJacobianAssembler.cpp.
|
private |
Definition at line 56 of file ForwardDifferencesJacobianAssembler.h.
Referenced by ForwardDifferencesJacobianAssembler(), and assembleWithJacobian().
|
private |
Definition at line 62 of file ForwardDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().
|
private |
Definition at line 61 of file ForwardDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().
|
private |
Definition at line 60 of file ForwardDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().
|
private |
Definition at line 63 of file ForwardDifferencesJacobianAssembler.h.
Referenced by assembleWithJacobian().