OGS
ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction > Class Template Reference

Detailed Description

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

Models the computation of natural coordinates inside a given mesh element for some given real coordinates as a root finding problem.

That root finding problem is designed such that it can be easily used/solved by the NumLib::NewtonRaphson solver.

Definition at line 28 of file ComputeNaturalCoordsRootFindingProblem.h.

#include <ComputeNaturalCoordsRootFindingProblem.h>

Collaboration diagram for ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >:
[legend]

Public Types

using LocalJacobianMatrix
 
using LocalResidualVector = Eigen::Matrix<double, Dim, 1>
 

Public Member Functions

 ComputeNaturalCoordsRootFindingProblem (MeshLib::Element const &e, LocalResidualVector const &x_expected)
 
void updateJacobian (LocalJacobianMatrix &J) const
 
void updateResidual (LocalResidualVector &res) const
 
void updateSolution (LocalResidualVector const &delta_r)
 
LocalResidualVector const & getNaturalCoordinates () const
 

Private Types

using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, Dim>
 
using NodeCoordsMatrix
 

Private Member Functions

void updateShp ()
 

Static Private Member Functions

static NodeCoordsMatrix getNodeCoords (MeshLib::Element const &e)
 
static constexpr LocalResidualVector initialGuess ()
 

Private Attributes

MeshLib::Element const & e_
 
NodeCoordsMatrix const node_coords_
 
LocalResidualVector const x_expected_
 
ShapeMatricesType::ShapeMatrices sm_
 
LocalResidualVector r_ = initialGuess()
 

Static Private Attributes

static constexpr int Dim = ShapeFunction::DIM
 

Member Typedef Documentation

◆ LocalJacobianMatrix

template<typename ShapeFunction >
using ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::LocalJacobianMatrix
Initial value:
Eigen::Matrix<double, Dim, Dim, Eigen::RowMajor>

Definition at line 34 of file ComputeNaturalCoordsRootFindingProblem.h.

◆ LocalResidualVector

template<typename ShapeFunction >
using ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::LocalResidualVector = Eigen::Matrix<double, Dim, 1>

Used for the residuum ("res"), the solution vector ("r", natural coordinates) and real coordinates ("x").

Definition at line 38 of file ComputeNaturalCoordsRootFindingProblem.h.

◆ NodeCoordsMatrix

template<typename ShapeFunction >
using ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::NodeCoordsMatrix
private
Initial value:
Eigen::Matrix<double, Dim, ShapeFunction::NPOINTS, Eigen::RowMajor>

Definition at line 79 of file ComputeNaturalCoordsRootFindingProblem.h.

◆ ShapeMatricesType

template<typename ShapeFunction >
using ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, Dim>
private

Definition at line 31 of file ComputeNaturalCoordsRootFindingProblem.h.

Constructor & Destructor Documentation

◆ ComputeNaturalCoordsRootFindingProblem()

template<typename ShapeFunction >
ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::ComputeNaturalCoordsRootFindingProblem ( MeshLib::Element const & e,
LocalResidualVector const & x_expected )
inline

Member Function Documentation

◆ getNaturalCoordinates()

◆ getNodeCoords()

template<typename ShapeFunction >
static NodeCoordsMatrix ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::getNodeCoords ( MeshLib::Element const & e)
inlinestaticprivate

Definition at line 93 of file ComputeNaturalCoordsRootFindingProblem.h.

94 {
95 NodeCoordsMatrix node_coords;
96
97 for (std::size_t n = 0; n < ShapeFunction::NPOINTS; ++n)
98 {
99 node_coords.col(n) = Eigen::Map<const Eigen::Vector<double, Dim>>(
100 e.getNode(n)->data());
101 }
102
103 return node_coords;
104 }
Eigen::Matrix< double, Dim, ShapeFunction::NPOINTS, Eigen::RowMajor > NodeCoordsMatrix

References MathLib::Point3d::data(), and MeshLib::Element::getNode().

◆ initialGuess()

template<typename ShapeFunction >
static constexpr LocalResidualVector ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::initialGuess ( )
inlinestaticconstexprprivate

Definition at line 106 of file ComputeNaturalCoordsRootFindingProblem.h.

107 {
108 return LocalResidualVector::Constant(0.5);
109 }

◆ updateJacobian()

◆ updateResidual()

◆ updateShp()

◆ updateSolution()

template<typename ShapeFunction >
void ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::updateSolution ( LocalResidualVector const & delta_r)
inline

Updates the current guess.

Parameters
delta_rthe solution increment (natural coordinates)

Definition at line 70 of file ComputeNaturalCoordsRootFindingProblem.h.

71 {
72 r_ += delta_r;
73 updateShp();
74 }

References ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::r_, and ApplicationUtils::ComputeNaturalCoordsRootFindingProblem< ShapeFunction >::updateShp().

Member Data Documentation

◆ Dim

◆ e_

◆ node_coords_

◆ r_

◆ sm_

◆ x_expected_


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