OGS
ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction > Class Template Reference

Detailed Description

template<typename ShapeFunction>
class ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction >

Definition at line 42 of file ComputeNaturalCoordsSolver.h.

#include <ComputeNaturalCoordsSolver.h>

Inheritance diagram for ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction >:
[legend]
Collaboration diagram for ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction >:
[legend]

Public Member Functions

Eigen::Vector3d solve (MeshLib::Element const &e, Eigen::Vector3d const &real_coords, int const max_iter, double const real_coords_tolerance) const override
Public Member Functions inherited from ApplicationUtils::ComputeNaturalCoordsSolverInterface
virtual ~ComputeNaturalCoordsSolverInterface ()=default

Private Types

using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, ElementDim>

Static Private Attributes

static constexpr int ElementDim = ShapeFunction::DIM

Member Typedef Documentation

◆ ShapeMatricesType

Member Function Documentation

◆ solve()

template<typename ShapeFunction>
Eigen::Vector3d ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction >::solve ( MeshLib::Element const & e,
Eigen::Vector3d const & real_coords,
int const max_iter,
double const real_coords_tolerance ) const
inlineoverridevirtual

Implements ApplicationUtils::ComputeNaturalCoordsSolverInterface.

Definition at line 49 of file ComputeNaturalCoordsSolver.h.

53 {
55 using LJM = typename Problem::LocalJacobianMatrix;
56 using LRV = typename Problem::LocalResidualVector;
57
59
62
63 const double increment_tolerance = 0;
66 [&problem](LJM& J) { problem.updateJacobian(J); },
67 [&problem](LRV& res) { problem.updateResidual(res); },
68 [&problem](auto& delta_r) { problem.updateSolution(delta_r); },
70
72
73 if (opt_iter)
74 {
75 DBUG("Newton solver succeeded after {} iterations", *opt_iter);
76
78 natural_coords.head<ElementDim>() = problem.getNaturalCoordinates();
79 return natural_coords;
80 }
81
83 "Newton solver failed. Please consider increasing the error "
84 "tolerance or the max. number of Newton iterations.");
85 }
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
Eigen::Vector3d solve(MeshLib::Element const &e, Eigen::Vector3d const &real_coords, int const max_iter, double const real_coords_tolerance) const override
NewtonRaphson< LinearSolver, JacobianMatrixUpdate, ResidualUpdate, SolutionUpdate > makeNewtonRaphson(LinearSolver &linear_solver, JacobianMatrixUpdate &&jacobian_update, ResidualUpdate &&residual_update, SolutionUpdate &&solution_update, NewtonRaphsonSolverParameters const &solver_parameters)

References DBUG(), ElementDim, NumLib::makeNewtonRaphson(), and OGS_FATAL.

Member Data Documentation

◆ ElementDim

template<typename ShapeFunction>
int ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction >::ElementDim = ShapeFunction::DIM
staticconstexprprivate

Definition at line 45 of file ComputeNaturalCoordsSolver.h.

Referenced by solve().


The documentation for this class was generated from the following file: