OGS
NumLib Namespace Reference

Detailed Description

The numerical algorithms used in OpenGeoSys

Namespaces

 anonymous_namespace{DOFTableUtil.cpp}
 
 anonymous_namespace{LocalToGlobalIndexMap.cpp}
 
 detail
 

Classes

struct  SerialExecutor
 
struct  GlobalVectorProvider
 
struct  GlobalMatrixProvider
 
class  LocalToGlobalIndexMap
 
class  MatrixProvider
 
class  MeshComponentMap
 Multidirectional mapping between mesh entities and degrees of freedom. More...
 
class  SimpleMatrixVectorProvider
 
class  VectorProvider
 
struct  AssemblyException
 
class  ExtrapolatableElement
 
class  ExtrapolatableElementCollection
 
class  ExtrapolatableLocalAssemblerCollection
 
class  Extrapolator
 
class  LocalLinearLeastSquaresExtrapolator
 
struct  NaturalCoordinatesMapping
 
struct  NaturalCoordinates
 
struct  NaturalCoordinates< MeshLib::Line >
 
struct  NaturalCoordinates< MeshLib::Line3 >
 
struct  NaturalCoordinates< MeshLib::Tri >
 
struct  NaturalCoordinates< MeshLib::Tri6 >
 
struct  NaturalCoordinates< MeshLib::Quad >
 
struct  NaturalCoordinates< MeshLib::Quad8 >
 
struct  NaturalCoordinates< MeshLib::Quad9 >
 
struct  NaturalCoordinates< MeshLib::Tet >
 
struct  NaturalCoordinates< MeshLib::Tet10 >
 
struct  NaturalCoordinates< MeshLib::Prism >
 
struct  NaturalCoordinates< MeshLib::Prism15 >
 
struct  NaturalCoordinates< MeshLib::Pyramid >
 
struct  NaturalCoordinates< MeshLib::Pyramid13 >
 
struct  NaturalCoordinates< MeshLib::Hex >
 
struct  NaturalCoordinates< MeshLib::Hex20 >
 
struct  ShapeMatrices
 Coordinates mapping matrices at particular location. More...
 
struct  FePOINT1
 
struct  FeLINE2
 
struct  FeLINE3
 
struct  FeTRI3
 
struct  FeTRI6
 
struct  FeQUAD4
 
struct  FeQUAD8
 
struct  FeQUAD9
 
struct  FeHEX8
 
struct  FeHEX20
 
struct  FeTET4
 
struct  FeTET10
 
struct  FePRISM6
 
struct  FePRISM15
 
struct  FePYRA5
 
struct  FePYRA13
 
struct  LowerDim
 
struct  LowerDim< NumLib::ShapeLine3 >
 
struct  LowerDim< NumLib::ShapeQuad8 >
 
struct  LowerDim< NumLib::ShapeQuad9 >
 
struct  LowerDim< NumLib::ShapeHex20 >
 
struct  LowerDim< NumLib::ShapeTri6 >
 
struct  LowerDim< NumLib::ShapeTet10 >
 
struct  LowerDim< NumLib::ShapePrism15 >
 
struct  LowerDim< NumLib::ShapePyra13 >
 
class  TemplateIsoparametric
 Template class for isoparametric elements. More...
 
struct  GaussLegendreIntegrationPolicy
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Point >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tri >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tri6 >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tet >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tet10 >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Prism >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Prism15 >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Pyramid >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Pyramid13 >
 
class  IntegrationGaussLegendrePrism
 Gauss-Legendre quadrature rule for prisms. More...
 
class  IntegrationGaussLegendrePyramid
 Gauss-Legendre quadrature rule for pyramid. More...
 
class  IntegrationGaussLegendreRegular
 
class  IntegrationGaussLegendreTet
 Gauss-Legendre quadrature rule for tetrahedrals. More...
 
class  IntegrationGaussLegendreTri
 Gauss-Legendre quadrature rule for triangles. More...
 
class  IntegrationPoint
 
class  ShapeHex20
 
class  ShapeHex8
 
class  ShapeLine2
 
class  ShapeLine3
 
class  ShapePoint1
 Shape function for a point element in natural coordinates. More...
 
class  ShapePrism15
 
class  ShapePrism6
 
class  ShapePyra13
 
class  ShapePyra5
 
class  ShapeQuad4
 
class  ShapeQuad8
 
class  ShapeQuad9
 
class  ShapeTet10
 
class  ShapeTet4
 
class  ShapeTri3
 
class  ShapeTri6
 
class  ISpatialFunction
 Interface class for any functions of spatial coordinates \(f(x,y,z)\). More...
 
struct  IndexValueVector
 
struct  NewtonRaphsonSolverParameters
 
class  NewtonRaphson
 
class  ConvergenceCriterion
 
class  ConvergenceCriterionDeltaX
 
class  ConvergenceCriterionPerComponent
 
class  ConvergenceCriterionPerComponentDeltaX
 
class  ConvergenceCriterionPerComponentResidual
 
class  ConvergenceCriterionResidual
 
class  EquationSystem
 
class  MatrixTranslator
 
class  MatrixTranslator< ODESystemTag::FirstOrderImplicitQuasilinear >
 
class  MatrixTranslatorGeneral
 
class  MatrixTranslatorGeneral< ODESystemTag::FirstOrderImplicitQuasilinear >
 
class  NonlinearSolverBase
 
class  NonlinearSolver
 
class  NonlinearSolver< NonlinearSolverTag::Newton >
 
class  NonlinearSolver< NonlinearSolverTag::Picard >
 
struct  NonlinearSolverStatus
 Status of the non-linear solver. More...
 
class  NonlinearSystem
 
class  NonlinearSystem< NonlinearSolverTag::Newton >
 
class  NonlinearSystem< NonlinearSolverTag::Picard >
 
class  ODESystem
 
class  ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >
 
class  ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >
 
class  PETScNonlinearSolver
 
class  TimeDiscretization
 
class  BackwardEuler
 Backward Euler scheme. More...
 
class  TimeDiscretizedODESystemBase
 
class  TimeDiscretizedODESystem
 
class  TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >
 
class  TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >
 
class  EvolutionaryPIDcontroller
 
class  FixedTimeStepping
 Fixed time stepping algorithm. More...
 
class  IterationNumberBasedTimeStepping
 Iteration number based adaptive time stepping. More...
 
class  TimeStepAlgorithm
 Interface of time stepping algorithms. More...
 
class  TimeStep
 Time step object. More...
 

Enumerations

enum class  ComponentOrder { BY_COMPONENT , BY_LOCATION }
 Ordering of components in global matrix/vector. More...
 
enum class  ShapeMatrixType {
  N , DNDR , N_J , DNDR_J ,
  DNDX , ALL
}
 Shape matrix type to be calculated. More...
 
enum class  IterationResult : char { SUCCESS , FAILURE , REPEAT_ITERATION }
 Status flags telling the NonlinearSolver if an iteration succeeded. More...
 
enum class  NonlinearSolverTag : bool { Picard , Newton }
 Tag used to specify which nonlinear solver will be used. More...
 
enum class  ODESystemTag : char { FirstOrderImplicitQuasilinear , NeumannBC }
 Tag used to specify the type of ODE. More...
 

Functions

NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters (BaseLib::ConfigTree const &config)
 
GlobalSparsityPattern computeSparsityPattern (LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
 Computes a sparsity pattern for the given inputs. More...
 
double getNonGhostNodalValue (GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
 
double getNodalValue (GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
 
std::vector< GlobalIndexTypegetIndices (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices (std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< GlobalIndexType > &indices)
 
double norm (GlobalVector const &x, unsigned const global_component, MathLib::VecNormType norm_type, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
 
template<typename Functor >
void transformVariableFromGlobalVector (GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor mapFunction)
 
void cleanupGlobalMatrixProviders ()
 
std::ostream & operator<< (std::ostream &os, LocalToGlobalIndexMap const &map)
 
template<typename LocalAssemblerCollection , typename IntegrationPointValuesMethod >
ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection > makeExtrapolatable (LocalAssemblerCollection const &local_assemblers, IntegrationPointValuesMethod integration_point_values_method)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
std::ostream & operator<< (std::ostream &os, const ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape)
 
template<typename ShapeFunction , typename ShapeMatricesType >
NumLib::TemplateIsoparametric< ShapeFunction, ShapeMatricesType > createIsoparametricFiniteElement (MeshLib::Element const &e)
 
template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename PointContainer >
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices (MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
 
template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename IntegrationMethod >
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices (MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
 
template<typename ShapeFunction , typename ShapeMatricesType >
double interpolateXCoordinate (MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
 
template<typename ShapeFunction , typename ShapeMatricesType >
std::array< double, 3 > interpolateCoordinates (MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
 
template<typename NodalValues , typename ShapeMatrix , typename... ScalarTypes>
void shapeFunctionInterpolate (const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
 
template<typename LowerOrderShapeFunction , typename HigherOrderMeshElementType , int GlobalDim, typename EigenMatrixType >
void interpolateToHigherOrderNodes (MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)
 
std::unique_ptr< ConvergenceCriterioncreateConvergenceCriterion (BaseLib::ConfigTree const &config)
 Creates a convergence criterion from the given configuration. More...
 
bool checkRelativeTolerance (const double reltol, const double numerator, const double denominator)
 
std::unique_ptr< ConvergenceCriterionDeltaXcreateConvergenceCriterionDeltaX (const BaseLib::ConfigTree &config)
 
std::unique_ptr< ConvergenceCriterionPerComponentDeltaXcreateConvergenceCriterionPerComponentDeltaX (const BaseLib::ConfigTree &config)
 
std::unique_ptr< ConvergenceCriterionPerComponentResidualcreateConvergenceCriterionPerComponentResidual (const BaseLib::ConfigTree &config)
 
std::unique_ptr< ConvergenceCriterionResidualcreateConvergenceCriterionResidual (const BaseLib::ConfigTree &config)
 
template<ODESystemTag ODETag>
std::unique_ptr< MatrixTranslator< ODETag > > createMatrixTranslator (TimeDiscretization const &timeDisc)
 
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTagcreateNonlinearSolver (GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeDiscretizationcreateTimeDiscretization (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateEvolutionaryPIDcontroller (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateFixedTimeStepping (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateIterationNumberBasedTimeStepping (BaseLib::ConfigTree const &config)
 
double possiblyClampDtToNextFixedTime (double const t, double const dt, std::vector< double > const &fixed_output_times)
 
std::unique_ptr< TimeStepAlgorithmcreateTimeStepper (BaseLib::ConfigTree const &config)
 

Enumeration Type Documentation

◆ ComponentOrder

Ordering of components in global matrix/vector.

Enumerator
BY_COMPONENT 

Ordering data by component type.

BY_LOCATION 

Ordering data by spatial location.

Definition at line 22 of file MeshComponentMap.h.

23 {
24  BY_COMPONENT,
26 };
@ BY_LOCATION
Ordering data by spatial location.
@ BY_COMPONENT
Ordering data by component type.

◆ ShapeMatrixType

Shape matrix type to be calculated.

Enumerator

calculates N

DNDR 

calculates dNdr

N_J 

calculates N, dNdr, J, and detJ

DNDR_J 

calculates dNdr, J, and detJ

DNDX 

calculates dNdr, J, detJ, invJ, and dNdx

ALL 

calculates all

Definition at line 23 of file ShapeMatrices.h.

24 {
25  N,
26  DNDR,
27  N_J,
28  DNDR_J,
29  DNDX,
30  ALL
31 };
@ DNDR
calculates dNdr
@ N_J
calculates N, dNdr, J, and detJ
@ DNDR_J
calculates dNdr, J, and detJ
@ DNDX
calculates dNdr, J, detJ, invJ, and dNdx

Function Documentation

◆ checkRelativeTolerance()

bool NumLib::checkRelativeTolerance ( double const  reltol,
double const  numerator,
double const  denominator 
)

Returns if |numerator/denominator| < |reltol|. This method copes with the case that denominator = 0 by always adding epsilon to the denominator.

Definition at line 48 of file ConvergenceCriterion.cpp.

50 {
51  auto const eps = std::numeric_limits<double>::epsilon();
52  return std::abs(numerator) <
53  std::abs(reltol) * (std::abs(denominator) + eps);
54 }

Referenced by NumLib::ConvergenceCriterionDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentResidual::checkResidual(), and NumLib::ConvergenceCriterionResidual::checkResidual().

◆ cleanupGlobalMatrixProviders()

void NumLib::cleanupGlobalMatrixProviders ( )

Definition at line 34 of file GlobalMatrixProviders.cpp.

35 {
36  globalSetupGlobalMatrixVectorProvider.reset();
37 }

Referenced by ApplicationsLib::LinearSolverLibrarySetup::~LinearSolverLibrarySetup().

◆ computeShapeMatrices()

template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename PointContainer >
std::vector<typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator<typename ShapeMatricesType::ShapeMatrices> > NumLib::computeShapeMatrices ( MeshLib::Element const &  e,
bool const  is_axially_symmetric,
PointContainer const &  points 
)

Definition at line 24 of file InitShapeMatrices.h.

26 {
27  std::vector<
28  typename ShapeMatricesType::ShapeMatrices,
29  Eigen::aligned_allocator<typename ShapeMatricesType::ShapeMatrices>>
30  shape_matrices;
31 
32  auto const fe =
33  createIsoparametricFiniteElement<ShapeFunction, ShapeMatricesType>(e);
34 
35  shape_matrices.reserve(points.size());
36  for (auto const& p : points)
37  {
38  shape_matrices.emplace_back(ShapeFunction::DIM, e.getDimension(),
39  ShapeFunction::NPOINTS);
40  fe.template computeShapeFunctions<SelectedShapeMatrixType>(
41  p.getCoords(), shape_matrices.back(), GlobalDim,
42  is_axially_symmetric);
43  }
44 
45  return shape_matrices;
46 }
static const double p

References MeshLib::Element::getDimension().

Referenced by NumLib::TemplateIsoparametric< ShapeFunctionType_, ShapeMatrixTypes_ >::computeShapeFunctions(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), initShapeMatrices(), and interpolateToHigherOrderNodes().

◆ computeSparsityPattern()

GlobalSparsityPattern NumLib::computeSparsityPattern ( LocalToGlobalIndexMap const &  dof_table,
MeshLib::Mesh const &  mesh 
)

Computes a sparsity pattern for the given inputs.

Parameters
dof_tablemaps mesh nodes to global indices
meshmesh for which the two parameters above are defined
Returns
The computed sparsity pattern.

Definition at line 74 of file ComputeSparsityPattern.cpp.

76 {
77 #ifdef USE_PETSC
78  return computeSparsityPatternPETSc(dof_table, mesh);
79 #else
80  return computeSparsityPatternNonPETSc(dof_table, mesh);
81 #endif
82 }
GlobalSparsityPattern computeSparsityPatternPETSc(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)

References computeSparsityPatternPETSc().

Referenced by ProcessLib::Process::computeSparsityPattern(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::constructDofTable(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::constructDofTable(), and ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::constructDofTable().

◆ createConvergenceCriterion()

std::unique_ptr< ConvergenceCriterion > NumLib::createConvergenceCriterion ( const BaseLib::ConfigTree config)

Creates a convergence criterion from the given configuration.

Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__type

Definition at line 22 of file ConvergenceCriterion.cpp.

24 {
26  auto const type = config.peekConfigParameter<std::string>("type");
27 
28  if (type == "DeltaX")
29  {
30  return createConvergenceCriterionDeltaX(config);
31  }
32  if (type == "Residual")
33  {
35  }
36  if (type == "PerComponentDeltaX")
37  {
39  }
40  if (type == "PerComponentResidual")
41  {
43  }
44 
45  OGS_FATAL("There is no convergence criterion of type `{:s}'.", type);
46 }
#define OGS_FATAL(...)
Definition: Error.h:26
T peekConfigParameter(std::string const &param) const
std::unique_ptr< ConvergenceCriterionResidual > createConvergenceCriterionResidual(const BaseLib::ConfigTree &config)
std::unique_ptr< ConvergenceCriterionPerComponentDeltaX > createConvergenceCriterionPerComponentDeltaX(const BaseLib::ConfigTree &config)
std::unique_ptr< ConvergenceCriterionDeltaX > createConvergenceCriterionDeltaX(const BaseLib::ConfigTree &config)
std::unique_ptr< ConvergenceCriterionPerComponentResidual > createConvergenceCriterionPerComponentResidual(const BaseLib::ConfigTree &config)

References createConvergenceCriterionDeltaX(), createConvergenceCriterionPerComponentDeltaX(), createConvergenceCriterionPerComponentResidual(), createConvergenceCriterionResidual(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by ProcessLib::createPerProcessData(), and ProcessLib::createTimeLoop().

◆ createConvergenceCriterionDeltaX()

std::unique_ptr< ConvergenceCriterionDeltaX > NumLib::createConvergenceCriterionDeltaX ( const BaseLib::ConfigTree config)
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__type
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__DeltaX__abstol
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__DeltaX__reltol
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__DeltaX__norm_type

Definition at line 61 of file ConvergenceCriterionDeltaX.cpp.

63 {
65  config.checkConfigParameter("type", "DeltaX");
66 
68  auto abstol = config.getConfigParameterOptional<double>("abstol");
70  auto reltol = config.getConfigParameterOptional<double>("reltol");
71  auto const norm_type_str =
73  config.getConfigParameter<std::string>("norm_type");
74  auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
75 
76  if (norm_type == MathLib::VecNormType::INVALID)
77  {
78  OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
79  }
80 
81  return std::make_unique<ConvergenceCriterionDeltaX>(
82  std::move(abstol), std::move(reltol), norm_type);
83 }
void checkConfigParameter(std::string const &param, T const &value) const
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
VecNormType convertStringToVecNormType(const std::string &str)
convert string to VecNormType
Definition: LinAlgEnums.cpp:32

References BaseLib::ConfigTree::checkConfigParameter(), MathLib::convertStringToVecNormType(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), MathLib::INVALID, and OGS_FATAL.

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionPerComponentDeltaX()

std::unique_ptr< ConvergenceCriterionPerComponentDeltaX > NumLib::createConvergenceCriterionPerComponentDeltaX ( const BaseLib::ConfigTree config)
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__type
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__PerComponentDeltaX__abstols
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__PerComponentDeltaX__reltols
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__PerComponentDeltaX__norm_type

Definition at line 91 of file ConvergenceCriterionPerComponentDeltaX.cpp.

92 {
94  config.checkConfigParameter("type", "PerComponentDeltaX");
95 
96  auto abstols =
98  config.getConfigParameterOptional<std::vector<double>>("abstols");
99  auto reltols =
101  config.getConfigParameterOptional<std::vector<double>>("reltols");
102  auto const norm_type_str =
104  config.getConfigParameter<std::string>("norm_type");
105 
106  if ((!abstols) && (!reltols))
107  {
108  OGS_FATAL(
109  "At least one of absolute or relative tolerance has to be "
110  "specified.");
111  }
112  if (!abstols)
113  {
114  abstols = std::vector<double>(reltols->size());
115  }
116  else if (!reltols)
117  {
118  reltols = std::vector<double>(abstols->size());
119  }
120 
121  auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
122 
123  if (norm_type == MathLib::VecNormType::INVALID)
124  {
125  OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
126  }
127 
128  return std::make_unique<ConvergenceCriterionPerComponentDeltaX>(
129  std::move(*abstols), std::move(*reltols), norm_type);
130 }

References BaseLib::ConfigTree::checkConfigParameter(), MathLib::convertStringToVecNormType(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), MathLib::INVALID, and OGS_FATAL.

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionPerComponentResidual()

std::unique_ptr< ConvergenceCriterionPerComponentResidual > NumLib::createConvergenceCriterionPerComponentResidual ( const BaseLib::ConfigTree config)
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__type
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__PerComponentResidual__abstols
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__PerComponentResidual__reltols
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__PerComponentResidual__norm_type

Definition at line 128 of file ConvergenceCriterionPerComponentResidual.cpp.

130 {
132  config.checkConfigParameter("type", "PerComponentResidual");
133 
134  auto abstols =
136  config.getConfigParameterOptional<std::vector<double>>("abstols");
137  auto reltols =
139  config.getConfigParameterOptional<std::vector<double>>("reltols");
140  auto const norm_type_str =
142  config.getConfigParameter<std::string>("norm_type");
143 
144  if ((!abstols) && (!reltols))
145  {
146  OGS_FATAL(
147  "At least one of absolute or relative tolerance has to be "
148  "specified.");
149  }
150  if (!abstols)
151  {
152  abstols = std::vector<double>(reltols->size());
153  }
154  else if (!reltols)
155  {
156  reltols = std::vector<double>(abstols->size());
157  }
158 
159  auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
160 
161  if (norm_type == MathLib::VecNormType::INVALID)
162  {
163  OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
164  }
165 
166  return std::make_unique<ConvergenceCriterionPerComponentResidual>(
167  std::move(*abstols), std::move(*reltols), norm_type);
168 }

References BaseLib::ConfigTree::checkConfigParameter(), MathLib::convertStringToVecNormType(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), MathLib::INVALID, and OGS_FATAL.

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionResidual()

std::unique_ptr< ConvergenceCriterionResidual > NumLib::createConvergenceCriterionResidual ( const BaseLib::ConfigTree config)
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__type
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__Residual__abstol
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__Residual__reltol
Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__Residual__norm_type

Definition at line 95 of file ConvergenceCriterionResidual.cpp.

96 {
98  config.checkConfigParameter("type", "Residual");
99 
101  auto abstol = config.getConfigParameterOptional<double>("abstol");
103  auto reltol = config.getConfigParameterOptional<double>("reltol");
104  auto const norm_type_str =
106  config.getConfigParameter<std::string>("norm_type");
107  auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
108 
109  if (norm_type == MathLib::VecNormType::INVALID)
110  {
111  OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
112  }
113 
114  return std::make_unique<ConvergenceCriterionResidual>(
115  std::move(abstol), std::move(reltol), norm_type);
116 }

References BaseLib::ConfigTree::checkConfigParameter(), MathLib::convertStringToVecNormType(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), MathLib::INVALID, and OGS_FATAL.

Referenced by createConvergenceCriterion().

◆ createEvolutionaryPIDcontroller()

std::unique_ptr< TimeStepAlgorithm > NumLib::createEvolutionaryPIDcontroller ( BaseLib::ConfigTree const &  config)

Create an EvolutionaryPIDcontroller time stepper from the given configuration

Input File Parameter:
prj__time_loop__processes__process__time_stepping__type
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__t_initial
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__t_end
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__dt_guess
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__dt_min
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__dt_max
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__rel_dt_min
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__rel_dt_max
Input File Parameter:
prj__time_loop__processes__process__time_stepping__EvolutionaryPIDcontroller__tol

Definition at line 22 of file CreateEvolutionaryPIDcontroller.cpp.

24 {
26  config.checkConfigParameter("type", "EvolutionaryPIDcontroller");
27 
29  auto const t0 = config.getConfigParameter<double>("t_initial");
31  auto const t_end = config.getConfigParameter<double>("t_end");
33  auto const h0 = config.getConfigParameter<double>("dt_guess");
34 
36  auto const h_min = config.getConfigParameter<double>("dt_min");
38  auto const h_max = config.getConfigParameter<double>("dt_max");
40  auto const rel_h_min = config.getConfigParameter<double>("rel_dt_min");
42  auto const rel_h_max = config.getConfigParameter<double>("rel_dt_max");
43 
45  auto const tol = config.getConfigParameter<double>("tol");
46 
47  return std::make_unique<EvolutionaryPIDcontroller>(
48  t0, t_end, h0, h_min, h_max, rel_h_min, rel_h_max, tol);
49 }

References BaseLib::ConfigTree::checkConfigParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by createTimeStepper().

◆ createFixedTimeStepping()

std::unique_ptr< TimeStepAlgorithm > NumLib::createFixedTimeStepping ( BaseLib::ConfigTree const &  config)

Create a FixedTimeStepping time stepper from the given configuration

Input File Parameter:
prj__time_loop__processes__process__time_stepping__type
Input File Parameter:
prj__time_loop__processes__process__time_stepping__FixedTimeStepping__t_initial
Input File Parameter:
prj__time_loop__processes__process__time_stepping__FixedTimeStepping__t_end
Input File Parameter:
prj__time_loop__processes__process__time_stepping__FixedTimeStepping__timesteps
Input File Parameter:
prj__time_loop__processes__process__time_stepping__FixedTimeStepping__timesteps__pair
Input File Parameter:
prj__time_loop__processes__process__time_stepping__FixedTimeStepping__timesteps__pair__repeat
Input File Parameter:
prj__time_loop__processes__process__time_stepping__FixedTimeStepping__timesteps__pair__delta_t

Definition at line 24 of file CreateFixedTimeStepping.cpp.

26 {
28  config.checkConfigParameter("type", "FixedTimeStepping");
29 
31  auto const t_initial = config.getConfigParameter<double>("t_initial");
33  auto const t_end = config.getConfigParameter<double>("t_end");
35  auto const delta_ts = config.getConfigSubtree("timesteps");
36 
37  std::vector<double> timesteps;
38  double t_curr = t_initial;
39  double delta_t = 0.0;
40 
41  // TODO: consider adding call "listNonEmpty" to config tree
43  auto const range = delta_ts.getConfigSubtreeList("pair");
44  if (range.begin() == range.end())
45  {
46  OGS_FATAL("no timesteps have been given");
47  }
48  for (auto const pair : range)
49  {
51  auto const repeat = pair.getConfigParameter<std::size_t>("repeat");
53  delta_t = pair.getConfigParameter<double>("delta_t");
54 
55  if (repeat == 0)
56  {
57  OGS_FATAL("<repeat> is zero.");
58  }
59  if (delta_t <= 0.0)
60  {
61  OGS_FATAL("timestep <delta_t> is <= 0.0.");
62  }
63 
64  if (t_curr <= t_end)
65  {
66  auto const new_size = timesteps.size() + repeat;
67  try
68  {
69  timesteps.resize(new_size, delta_t);
70  }
71  catch (std::length_error const& e)
72  {
73  OGS_FATAL(
74  "Resize of the time steps vector failed for the requested "
75  "new size {:d}. Probably there is not enough memory ({:g} "
76  "GiB requested).\n"
77  "Thrown exception: {:s}",
78  new_size,
79  new_size * sizeof(double) / 1024. / 1024. / 1024.,
80  e.what());
81  }
82  catch (std::bad_alloc const& e)
83  {
84  OGS_FATAL(
85  "Resize of the time steps vector failed for the requested "
86  "new size {:d}. Probably there is not enough memory ({:g} "
87  "GiB requested).\n"
88  "Thrown exception: {:s}",
89  new_size, new_size * sizeof(double) / 1024. / 1024. / 1024.,
90  e.what());
91  }
92 
93  t_curr += repeat * delta_t;
94  }
95  }
96 
97  // append last delta_t until t_end is reached
98  if (t_curr <= t_end)
99  {
100  auto const repeat =
101  static_cast<std::size_t>(std::ceil((t_end - t_curr) / delta_t));
102  auto const new_size = timesteps.size() + repeat;
103  try
104  {
105  timesteps.resize(new_size, delta_t);
106  }
107  catch (std::length_error const& e)
108  {
109  OGS_FATAL(
110  "Resize of the time steps vector failed for the requested new "
111  "size {:d}. Probably there is not enough memory ({:g} GiB "
112  "requested).\n"
113  "Thrown exception: {:s}",
114  new_size,
115  new_size * sizeof(double) / 1024. / 1024. / 1024.,
116  e.what());
117  }
118  catch (std::bad_alloc const& e)
119  {
120  OGS_FATAL(
121  "Resize of the time steps vector failed for the requested new "
122  "size {:d}. Probably there is not enough memory ({:g} GiB "
123  "requested).\n"
124  "Thrown exception: {:s}",
125  new_size, new_size * sizeof(double) / 1024. / 1024. / 1024.,
126  e.what());
127  }
128  }
129 
130  return std::make_unique<FixedTimeStepping>(t_initial, t_end, timesteps);
131 }

References BaseLib::ConfigTree::checkConfigParameter(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeList(), and OGS_FATAL.

Referenced by createTimeStepper().

◆ createIsoparametricFiniteElement()

template<typename ShapeFunction , typename ShapeMatricesType >
NumLib::TemplateIsoparametric<ShapeFunction, ShapeMatricesType> NumLib::createIsoparametricFiniteElement ( MeshLib::Element const &  e)

Creates a TemplateIsoparametric element for the given shape functions and the underlying mesh element.

Definition at line 168 of file TemplateIsoparametric.h.

169 {
170  using FemType =
172 
173  return FemType{
174  *static_cast<const typename ShapeFunction::MeshElement*>(&e)};
175 }
Template class for isoparametric elements.

Referenced by ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), and ProcessLib::SourceTerms::Python::PythonSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble().

◆ createIterationNumberBasedTimeStepping()

std::unique_ptr< TimeStepAlgorithm > NumLib::createIterationNumberBasedTimeStepping ( BaseLib::ConfigTree const &  config)

Create a IterationNumberBasedTimeStepping time stepper from the given configuration.

Input File Parameter:
prj__time_loop__processes__process__time_stepping__type
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__t_initial
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__t_end
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__initial_dt
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__minimum_dt
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__maximum_dt
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__number_iterations
Input File Parameter:
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__multiplier

Definition at line 22 of file CreateIterationNumberBasedTimeStepping.cpp.

24 {
26  config.checkConfigParameter("type", "IterationNumberBasedTimeStepping");
27 
29  auto const t_initial = config.getConfigParameter<double>("t_initial");
31  auto const t_end = config.getConfigParameter<double>("t_end");
33  auto const initial_dt = config.getConfigParameter<double>("initial_dt");
35  auto const minimum_dt = config.getConfigParameter<double>("minimum_dt");
37  auto const maximum_dt = config.getConfigParameter<double>("maximum_dt");
38 
39  auto number_iterations =
41  config.getConfigParameter<std::vector<int>>("number_iterations");
42  auto multiplier =
44  config.getConfigParameter<std::vector<double>>("multiplier");
45 
46  return std::make_unique<IterationNumberBasedTimeStepping>(
47  t_initial, t_end, minimum_dt, maximum_dt, initial_dt,
48  std::move(number_iterations), std::move(multiplier));
49 }

References BaseLib::ConfigTree::checkConfigParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by createTimeStepper().

◆ createNewtonRaphsonSolverParameters()

NewtonRaphsonSolverParameters NumLib::createNewtonRaphsonSolverParameters ( BaseLib::ConfigTree const &  config)
Input File Parameter:
nonlinear_solver__maximum_iterations
Input File Parameter:
nonlinear_solver__error_tolerance
Input File Parameter:
nonlinear_solver__residuum_tolerance
Input File Parameter:
nonlinear_solver__increment_tolerance

Definition at line 17 of file CreateNewtonRaphsonSolverParameters.cpp.

19 {
20  DBUG("Create local nonlinear solver parameters.");
21  auto const maximum_iterations =
23  config.getConfigParameter<int>("maximum_iterations");
24 
25  DBUG("\tmaximum_iterations: {:d}.", maximum_iterations);
26 
27  auto const error_tolerance =
29  config.getConfigParameterOptional<double>("error_tolerance");
30  if (error_tolerance)
31  {
32  WARN(
33  "The 'error_tolerance' tag for the Newton-Raphson solver is "
34  "deprecated.\n"
35  "Use new tags 'residuum_tolerance' and 'increment_tolerance'.\n"
36  "For now we use residuum_tolerance {} and increment_tolerance 0.",
37  *error_tolerance);
38  return {maximum_iterations, *error_tolerance, 0};
39  }
40 
41  auto const residuum_tolerance =
43  config.getConfigParameter<double>("residuum_tolerance");
44 
45  DBUG("\tresiduum_tolerance: {:g}.", residuum_tolerance);
46 
47  auto const increment_tolerance =
49  config.getConfigParameter<double>("increment_tolerance");
50 
51  DBUG("\tincrement_tolerance: {:g}.", increment_tolerance);
52 
53  return {maximum_iterations, residuum_tolerance, increment_tolerance};
54 }
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
void WARN(char const *fmt, Args const &... args)
Definition: Logging.h:37

References DBUG(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), and WARN().

Referenced by MaterialLib::Fracture::createCoulomb(), MaterialLib::Solids::Creep::createCreepBGRa(), MaterialLib::Solids::Ehlers::createEhlers(), MaterialLib::Solids::Lubby2::createLubby2(), and ProcessLib::RichardsMechanics::createRichardsMechanicsProcess().

◆ createTimeDiscretization()

std::unique_ptr< TimeDiscretization > NumLib::createTimeDiscretization ( BaseLib::ConfigTree const &  config)
Input File Parameter:
prj__time_loop__processes__process__time_discretization__type
Input File Parameter:
prj__time_loop__processes__process__time_discretization__BackwardEuler

Definition at line 19 of file TimeDiscretizationBuilder.cpp.

21 {
23  auto const type = config.getConfigParameter<std::string>("type");
24 
26  if (type == "BackwardEuler")
27  {
28  return std::make_unique<BackwardEuler>();
29  }
30  OGS_FATAL("Unrecognized time discretization type `{:s}'", type);
31 }

References BaseLib::ConfigTree::getConfigParameter(), and OGS_FATAL.

Referenced by ProcessLib::createPerProcessData().

◆ createTimeStepper()

std::unique_ptr< TimeStepAlgorithm > NumLib::createTimeStepper ( BaseLib::ConfigTree const &  config)
Input File Parameter:
prj__time_loop__processes__process__time_stepping__type
Input File Parameter:
prj__time_loop__processes__process__time_stepping__SingleStep

Definition at line 26 of file CreateTimeStepper.cpp.

28 {
30  auto const type = config.peekConfigParameter<std::string>("type");
31 
32  if (type == "SingleStep")
33  {
35  config.ignoreConfigParameter("type");
36  return std::make_unique<NumLib::FixedTimeStepping>(0.0, 1.0, 1.0);
37  }
38  if (type == "FixedTimeStepping")
39  {
40  return NumLib::createFixedTimeStepping(config);
41  }
42  if (type == "EvolutionaryPIDcontroller")
43  {
45  }
46  if (type == "IterationNumberBasedTimeStepping")
47  {
49  }
50  OGS_FATAL(
51  "Unknown time stepping type: '{:s}'. The available types are: "
52  "\n\tSingleStep,"
53  "\n\tFixedTimeStepping,"
54  "\n\tEvolutionaryPIDcontroller,",
55  "\n\tIterationNumberBasedTimeStepping\n",
56  type.data());
57 }
std::unique_ptr< TimeStepAlgorithm > createIterationNumberBasedTimeStepping(BaseLib::ConfigTree const &config)
std::unique_ptr< TimeStepAlgorithm > createEvolutionaryPIDcontroller(BaseLib::ConfigTree const &config)
std::unique_ptr< TimeStepAlgorithm > createFixedTimeStepping(BaseLib::ConfigTree const &config)

References createEvolutionaryPIDcontroller(), createFixedTimeStepping(), createIterationNumberBasedTimeStepping(), BaseLib::ConfigTree::ignoreConfigParameter(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

Referenced by ProcessLib::createPerProcessData().

◆ getIndices()

std::vector< GlobalIndexType > NumLib::getIndices ( std::size_t const  mesh_item_id,
NumLib::LocalToGlobalIndexMap const &  dof_table 
)

Returns nodal indices for the item identified by mesh_item_id from the given dof_table.

Definition at line 124 of file DOFTableUtil.cpp.

127 {
128  assert(dof_table.size() > mesh_item_id);
129  std::vector<GlobalIndexType> indices;
130 
131  // Local matrices and vectors will always be ordered by component
132  // no matter what the order of the global matrix is.
133  for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c)
134  {
135  auto const& idcs = dof_table(mesh_item_id, c).rows;
136  indices.reserve(indices.size() + idcs.size());
137  indices.insert(indices.end(), idcs.begin(), idcs.end());
138  }
139 
140  return indices;
141 }

References MaterialPropertyLib::c, NumLib::LocalToGlobalIndexMap::getNumberOfGlobalComponents(), and NumLib::LocalToGlobalIndexMap::size().

Referenced by ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::VectorMatrixAssembler::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::VariableDependentNeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::SourceTerms::Python::PythonSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::assembleReactionEquation(), ProcessLib::VectorMatrixAssembler::assembleWithJacobian(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::computeCrackIntegral(), ProcessLib::LocalAssemblerInterface::computeSecondaryVariable(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::TES::TESLocalAssembler< ShapeFunction_, IntegrationMethod_, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocity(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocityGas(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocityLiquid(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtSaturation(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::initializeChemicalSystem(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::integrate(), ProcessLib::LocalAssemblerInterface::postNonLinearSolver(), ProcessLib::LocalAssemblerInterface::postTimestep(), ProcessLib::VectorMatrixAssembler::preAssemble(), ProcessLib::LocalAssemblerInterface::preTimestep(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::setChemicalSystem(), ProcessLib::LocalAssemblerInterface::setInitialConditions(), and ProcessLib::SmallDeformation::writeMaterialForces().

◆ getNodalValue()

double NumLib::getNodalValue ( GlobalVector const &  x,
MeshLib::Mesh const &  mesh,
NumLib::LocalToGlobalIndexMap const &  dof_table,
std::size_t const  node_id,
std::size_t const  global_component_id 
)

Returns the value for the given node_id and global_component_id from the vector x.

Definition at line 110 of file DOFTableUtil.cpp.

114 {
115  MeshLib::Location const l{mesh.getID(), MeshLib::MeshItemType::Node,
116  node_id};
117 
118  auto const index = dof_table.getGlobalIndex(l, global_component_id);
119  assert(index != NumLib::MeshComponentMap::nop);
120 
121  return x.get(index);
122 }
static NUMLIB_EXPORT GlobalIndexType const nop

References MathLib::EigenVector::get(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), MeshLib::Mesh::getID(), MeshLib::Node, and NumLib::MeshComponentMap::nop.

Referenced by ProcessLib::TES::TESProcess::computeEquilibriumLoading(), ProcessLib::TES::TESProcess::computeRelativeHumidity(), and ProcessLib::TES::TESProcess::computeVapourPartialPressure().

◆ getNonGhostNodalValue()

double NumLib::getNonGhostNodalValue ( GlobalVector const &  x,
MeshLib::Mesh const &  mesh,
NumLib::LocalToGlobalIndexMap const &  dof_table,
std::size_t const  node_id,
std::size_t const  global_component_id 
)

Returns the value for the given node_id and global_component_id from the vector x in case the node is not a ghost node. Else 0.0 is returned.

Definition at line 91 of file DOFTableUtil.cpp.

95 {
96  MeshLib::Location const l{mesh.getID(), MeshLib::MeshItemType::Node,
97  node_id};
98 
99  auto const index = dof_table.getGlobalIndex(l, global_component_id);
100  assert(index != NumLib::MeshComponentMap::nop);
101 
102  if (index < 0)
103  { // ghost node value
104  return 0.0;
105  }
106 
107  return x.get(index);
108 }

References MathLib::EigenVector::get(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), MeshLib::Mesh::getID(), MeshLib::Node, and NumLib::MeshComponentMap::nop.

Referenced by NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm().

◆ getRowColumnIndices()

LocalToGlobalIndexMap::RowColumnIndices NumLib::getRowColumnIndices ( std::size_t const  id,
NumLib::LocalToGlobalIndexMap const &  dof_table,
std::vector< GlobalIndexType > &  indices 
)

Returns row/column indices for the item identified by id from the given dof_table.

Definition at line 143 of file DOFTableUtil.cpp.

147 {
148  assert(dof_table.size() > id);
149  indices.clear();
150 
151  // Local matrices and vectors will always be ordered by component,
152  // no matter what the order of the global matrix is.
153  for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c)
154  {
155  auto const& idcs = dof_table(id, c).rows;
156  indices.reserve(indices.size() + idcs.size());
157  indices.insert(indices.end(), idcs.begin(), idcs.end());
158  }
159 
160  return NumLib::LocalToGlobalIndexMap::RowColumnIndices(indices, indices);
161 }
MathLib::RowColumnIndices< GlobalIndexType > RowColumnIndices

References MaterialPropertyLib::c, NumLib::LocalToGlobalIndexMap::getNumberOfGlobalComponents(), and NumLib::LocalToGlobalIndexMap::size().

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::getFlux(), ProcessLib::LiquidFlow::LiquidFlowProcess::getFlux(), ProcessLib::HT::HTProcess::getFlux(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::getFlux(), and ProcessLib::TES::TESProcess::postIterationConcreteProcess().

◆ initShapeMatrices()

template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename IntegrationMethod >
std::vector<typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator<typename ShapeMatricesType::ShapeMatrices> > NumLib::initShapeMatrices ( MeshLib::Element const &  e,
bool const  is_axially_symmetric,
IntegrationMethod const &  integration_method 
)

Definition at line 53 of file InitShapeMatrices.h.

55 {
56  int const n_integration_points = integration_method.getNumberOfPoints();
57 
58  std::vector<typename IntegrationMethod::WeightedPoint> points;
59  points.reserve(n_integration_points);
60  for (int ip = 0; ip < n_integration_points; ++ip)
61  {
62  points.push_back(integration_method.getWeightedPoint(ip));
63  }
64 
65  return computeShapeMatrices<ShapeFunction, ShapeMatricesType, GlobalDim,
66  SelectedShapeMatrixType>(
67  e, is_axially_symmetric, points);
68 }
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)

References computeShapeMatrices().

Referenced by ProcessLib::ConstraintDirichletBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::ConstraintDirichletBoundaryConditionLocalAssembler(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, IntegrationMethod, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::HeatTransportBHELocalAssemblerSoil(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::HTFEM(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::HydroMechanicsLocalAssemblerMatrix(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::LiquidFlowLocalAssembler(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::LocalAssemblerData(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::LocalAssemblerData(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::LocalAssemblerData(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::PhaseFieldLocalAssembler(), ProcessLib::SourceTerms::Python::PythonSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::PythonSourceTermLocalAssembler(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::RichardsMechanicsLocalAssembler(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerMatrixNearFracture(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationNonlocalLocalAssembler(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::SurfaceFluxLocalAssembler(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::TH2MLocalAssembler(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::ThermalTwoPhaseFlowWithPPLocalAssembler(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::ThermoHydroMechanicsLocalAssembler(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoMechanicalPhaseFieldLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoMechanicsLocalAssembler(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoRichardsMechanicsLocalAssembler(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::TwoPhaseFlowWithPPLocalAssembler(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::VolumetricSourceTermLocalAssembler(), and ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::initNsAndWeights().

◆ interpolateCoordinates()

template<typename ShapeFunction , typename ShapeMatricesType >
std::array<double, 3> NumLib::interpolateCoordinates ( MeshLib::Element const &  e,
typename ShapeMatricesType::ShapeMatrices::ShapeType const &  N 
)

Definition at line 82 of file InitShapeMatrices.h.

85 {
86  auto const fe =
87  createIsoparametricFiniteElement<ShapeFunction, ShapeMatricesType>(e);
88 
89  return fe.interpolateCoordinates(N);
90 }

References N.

Referenced by ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), and ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::integrate().

◆ interpolateToHigherOrderNodes()

template<typename LowerOrderShapeFunction , typename HigherOrderMeshElementType , int GlobalDim, typename EigenMatrixType >
void NumLib::interpolateToHigherOrderNodes ( MeshLib::Element const &  element,
bool const  is_axially_symmetric,
Eigen::MatrixBase< EigenMatrixType > const &  node_values,
MeshLib::PropertyVector< double > &  interpolated_values_global_vector 
)

Interpolates scalar node_values given in lower order element nodes (e.g. the base nodes) to higher order element's nodes (e.g. quadratic nodes) and writes the result into the global property vector.

The base nodes' values are copied. For each higher order node the shape matrices are evaluated for the lower order element (the base nodes), and used for the the scalar quantity interpolation.

Definition at line 106 of file Interpolation.h.

110 {
111  assert(dynamic_cast<HigherOrderMeshElementType const*>(&element));
112  assert(node_values.cols() == 1); // Scalar quantity only.
113 
114  using SF = LowerOrderShapeFunction;
115  using ShapeMatricesType = ShapeMatrixPolicyType<SF, GlobalDim>;
116 
117  int const number_base_nodes = element.getNumberOfBaseNodes();
118  int const number_all_nodes = element.getNumberOfNodes();
119 
120  // Copy the values for linear nodes.
121  for (int n = 0; n < number_base_nodes; ++n)
122  {
123  std::size_t const global_index = getNodeIndex(element, n);
124  interpolated_values_global_vector[global_index] = node_values[n];
125  }
126 
127  //
128  // Interpolate values for higher order nodes.
129  //
130 
131  int const number_higher_order_nodes = number_all_nodes - number_base_nodes;
132  std::vector<MathLib::Point3d> higher_order_nodes;
133  higher_order_nodes.reserve(number_higher_order_nodes);
134  for (int n = 0; n < number_higher_order_nodes; ++n)
135  {
136  higher_order_nodes.emplace_back(
137  NaturalCoordinates<HigherOrderMeshElementType>::coordinates
138  [number_base_nodes + n]);
139  }
140 
141  // Shape matrices evaluated at higher order nodes' coordinates.
142  auto const shape_matrices =
143  computeShapeMatrices<SF, ShapeMatricesType, GlobalDim,
144  ShapeMatrixType::N>(element, is_axially_symmetric,
145  higher_order_nodes);
146 
147  for (int n = 0; n < number_higher_order_nodes; ++n)
148  {
149  std::size_t const global_index =
150  getNodeIndex(element, number_base_nodes + n);
151  interpolated_values_global_vector[global_index] =
152  shape_matrices[n].N * node_values;
153  }
154 }
std::size_t getNodeIndex(Element const &element, unsigned const idx)
Definition: Element.cpp:225

References computeShapeMatrices(), MeshLib::getNodeIndex(), MeshLib::Element::getNumberOfBaseNodes(), MeshLib::Element::getNumberOfNodes(), and N.

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::computeSecondaryVariableConcrete(), and ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::postTimestepConcreteWithBlockVectors().

◆ interpolateXCoordinate()

template<typename ShapeFunction , typename ShapeMatricesType >
double NumLib::interpolateXCoordinate ( MeshLib::Element const &  e,
typename ShapeMatricesType::ShapeMatrices::ShapeType const &  N 
)

Definition at line 71 of file InitShapeMatrices.h.

74 {
75  auto const fe =
76  createIsoparametricFiniteElement<ShapeFunction, ShapeMatricesType>(e);
77 
78  return fe.interpolateZerothCoordinate(N);
79 }

References N.

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assemble(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::assembleBlockMatricesWithJacobian(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getNodalValues(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::postNonLinearSolverConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::postNonLinearSolverConcrete(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::postTimestepConcreteWithBlockVectors(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::preAssemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::setInitialConditionsConcrete(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::updateConstitutiveVariables().

◆ makeExtrapolatable()

template<typename LocalAssemblerCollection , typename IntegrationPointValuesMethod >
ExtrapolatableLocalAssemblerCollection<LocalAssemblerCollection> NumLib::makeExtrapolatable ( LocalAssemblerCollection const &  local_assemblers,
IntegrationPointValuesMethod  integration_point_values_method 
)

Creates an ExtrapolatableLocalAssemblerCollection, which can be used to provide information to an Extrapolator.

Definition at line 149 of file ExtrapolatableElementCollection.h.

151 {
152  return ExtrapolatableLocalAssemblerCollection<LocalAssemblerCollection>{
153  local_assemblers, integration_point_values_method};
154 }

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::extrapolateIntegrationPointValuesToNodes(), and ProcessLib::makeExtrapolator().

◆ norm()

double NumLib::norm ( GlobalVector const &  x,
unsigned const  global_component,
MathLib::VecNormType  norm_type,
LocalToGlobalIndexMap const &  dof_table,
MeshLib::Mesh const &  mesh 
)

Computes the specified norm of the given global component of the given vector x.

Remarks
x is typically the solution vector of a monolithically coupled process with several primary variables.

Definition at line 163 of file DOFTableUtil.cpp.

166 {
167  switch (norm_type)
168  {
170  return norm1(x, global_component, dof_table, mesh);
172  return norm2(x, global_component, dof_table, mesh);
174  return normInfinity(x, global_component, dof_table, mesh);
175  default:
176  OGS_FATAL("An invalid norm type has been passed.");
177  }
178 }
double norm1(GlobalVector const &x, unsigned const global_component, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
double normInfinity(GlobalVector const &x, unsigned const global_component, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
double norm2(GlobalVector const &x, unsigned const global_component, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)

References MathLib::INFINITY_N, MathLib::NORM1, NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm1(), MathLib::NORM2, NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm2(), NumLib::anonymous_namespace{DOFTableUtil.cpp}::normInfinity(), and OGS_FATAL.

Referenced by NumLib::ConvergenceCriterionPerComponentDeltaX::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentResidual::checkDeltaX(), NumLib::ConvergenceCriterionPerComponentResidual::checkResidual(), NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm1(), NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm2(), and NumLib::anonymous_namespace{DOFTableUtil.cpp}::normInfinity().

◆ operator<<() [1/2]

template<class T_N , class T_DNDR , class T_J , class T_DNDX >
std::ostream& NumLib::operator<< ( std::ostream &  os,
const ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &  shape 
)

Definition at line 129 of file ShapeMatrices-impl.h.

131 {
132  shape.write(os);
133  return os;
134 }

References NumLib::ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX >::write().

◆ operator<<() [2/2]

std::ostream& NumLib::operator<< ( std::ostream &  os,
LocalToGlobalIndexMap const &  map 
)

Definition at line 453 of file LocalToGlobalIndexMap.cpp.

454 {
455  std::size_t const max_lines = 10;
456  std::size_t lines_printed = 0;
457 
458  os << "Rows of the local to global index map; " << map._rows.size()
459  << " rows\n";
460  for (std::size_t e = 0; e < map.size(); ++e)
461  {
462  os << "== e " << e << " ==\n";
463  for (int c = 0; c < map.getNumberOfGlobalComponents(); ++c)
464  {
465  auto const& line = map._rows(e, c);
466 
467  os << "c" << c << " { ";
468  std::copy(line.cbegin(), line.cend(),
469  std::ostream_iterator<std::size_t>(os, " "));
470  os << " }\n";
471  }
472 
473  if (lines_printed++ > max_lines)
474  {
475  os << "...\n";
476  break;
477  }
478  }
479 
480  os << "Mesh component map:\n" << map._mesh_component_map;
481  return os;
482 }
void copy(PETScVector const &x, PETScVector &y)
Definition: LinAlg.cpp:37

◆ possiblyClampDtToNextFixedTime()

double NumLib::possiblyClampDtToNextFixedTime ( double const  t,
double const  dt,
std::vector< double > const &  fixed_output_times 
)

If any of the fixed times will be reached with given time increment, it will be reduced, otherwise the input will be returned.

Precondition
The input vector of fixed times must be sorted.
Parameters
tCurrent time.
dtSuggested time increment.
fixed_output_timesSorted list of times which are to be reached.

Definition at line 17 of file TimeStepAlgorithm.cpp.

20 {
21  auto const specific_time = std::upper_bound(
22  std::cbegin(fixed_output_times), std::cend(fixed_output_times), t);
23 
24  if (specific_time == std::cend(fixed_output_times))
25  {
26  return dt;
27  }
28 
29  double const t_to_specific_time = *specific_time - t;
30  if ((t_to_specific_time > std::numeric_limits<double>::epsilon()) &&
31  (t + dt - *specific_time > 0.0))
32  {
33  return t_to_specific_time;
34  }
35 
36  return dt;
37 }

Referenced by ProcessLib::TimeLoop::computeTimeStepping().

◆ shapeFunctionInterpolate()

template<typename NodalValues , typename ShapeMatrix , typename... ScalarTypes>
void NumLib::shapeFunctionInterpolate ( const NodalValues &  nodal_values,
const ShapeMatrix &  shape_matrix_N,
double &  interpolated_value,
ScalarTypes &...  interpolated_values 
)

Interpolates variables given at element nodes according to the given shape matrix.

This function simply does the usual finite-element interpolation, i.e. multiplication of nodal values with the shape function.

Parameters
nodal_valuesvector of nodal values, ordered by component
shape_matrix_Nshape matrix of the point to which will be interpolated
interpolated_valueinterpolated value of the first d.o.f. (output parameter)
interpolated_valuesinterpolated value of further d.o.f. (output parameter)
Template Parameters
NodalValuestype of the container where nodal values are stored
ShapeMatrixtype of the shape matrix \(N\).
ScalarValuesall of the types in this pack must currently be double.
Note
nodal_values have to be ordered by component and it is assumed that all passed d.o.f. are single-component and are interpolated using the same shape function.

Definition at line 79 of file Interpolation.h.

83 {
84  auto const num_nodal_dof = sizeof...(interpolated_values) + 1;
85  auto const num_nodes = shape_matrix_N.size();
86 
87  assert(num_nodes * num_nodal_dof ==
88  static_cast<std::size_t>(nodal_values.size()));
89  (void)num_nodal_dof;
90  (void)num_nodes; // no warnings when not in debug build
91 
92  detail::shapeFunctionInterpolate<0>(nodal_values, shape_matrix_N,
93  interpolated_value,
94  interpolated_values...);
95 }

Referenced by ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction, IntegrationMethod >::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::VariableDependentNeumannBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleBlockMatrices(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleComponentTransportEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleHydraulicEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::assembleHydraulicEquation(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assembleMatrixAndVector(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::assembleReactionEquationConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::calculateIntPtDarcyVelocity(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::computeProjectedDarcyVelocity(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getFlux(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::TES::TESLocalAssembler< ShapeFunction_, IntegrationMethod_, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::HTFEM< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtDarcyVelocityLocal(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::getIntPtSaturation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::initializeChemicalSystemConcrete(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::interpolateNodalValuesToIntegrationPoints(), ProcessLib::TES::TESLocalAssemblerInner< Traits >::preEachAssembleIntegrationPoint(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, IntegrationMethod, GlobalDim >::setChemicalSystemConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::setInitialConditionsConcrete(), and ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::setInitialConditionsConcrete().

◆ transformVariableFromGlobalVector()

template<typename Functor >
void NumLib::transformVariableFromGlobalVector ( GlobalVector const &  input_vector,
int const  variable_id,
NumLib::LocalToGlobalIndexMap const &  local_to_global_index_map,
MeshLib::PropertyVector< double > &  output_vector,
Functor  mapFunction 
)

Copies part of a global vector for the given variable into output_vector while applying a function to each value.

Attention
The output_vector is accessed through node id and component, therefore multiple meshes are not supported.

Definition at line 59 of file DOFTableUtil.h.

63 {
65 
66  std::fill(begin(output_vector), end(output_vector),
67  std::numeric_limits<double>::quiet_NaN());
68 
69  int const n_components =
70  local_to_global_index_map.getNumberOfVariableComponents(variable_id);
71  for (int component = 0; component < n_components; ++component)
72  {
73  auto const& mesh_subset =
74  local_to_global_index_map.getMeshSubset(variable_id, component);
75  auto const mesh_id = mesh_subset.getMeshID();
76  for (auto const& node : mesh_subset.getNodes())
77  {
78  auto const node_id = node->getID();
80  node_id);
81  output_vector.getComponent(node_id, component) = mapFunction(
82  input_vector[local_to_global_index_map.getGlobalIndex(
83  l, variable_id, component)]);
84  }
85  }
86 }
PROP_VAL_TYPE & getComponent(std::size_t tuple_index, int component)
Returns the value for the given component stored in the given tuple.
void setLocalAccessibleVector(PETScVector const &x)
Definition: LinAlg.cpp:27

References MeshLib::PropertyVector< PROP_VAL_TYPE >::getComponent(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), MeshLib::MeshSubset::getMeshID(), NumLib::LocalToGlobalIndexMap::getMeshSubset(), NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents(), MeshLib::Node, and MathLib::LinAlg::setLocalAccessibleVector().

Referenced by ProcessLib::LiquidFlow::LiquidFlowProcess::assembleConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleWithJacobianConcreteProcess(), and ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess().