OGS
NumLib Namespace Reference

Namespaces

namespace  anonymous_namespace{DOFTableUtil.cpp}
 
namespace  detail
 
namespace  IntegrationMethodRegistry
 

Classes

struct  AssemblyException
 
class  BackwardEuler
 Backward Euler scheme. More...
 
struct  CentralDifferencesStrategy
 
class  ConvergenceCriterion
 
class  ConvergenceCriterionDeltaX
 
class  ConvergenceCriterionPerComponent
 
class  ConvergenceCriterionPerComponentDeltaX
 
class  ConvergenceCriterionPerComponentResidual
 
class  ConvergenceCriterionResidual
 
struct  CouplingNode
 Information of a coupling node. More...
 
class  DefaultIntegrationMethodProvider
 
struct  ElementTraitsLagrange
 
class  EquationSystem
 
class  EvolutionaryPIDcontroller
 
struct  EvolutionaryPIDcontrollerParameters
 
class  ExtrapolatableElement
 
class  ExtrapolatableElementCollection
 
class  ExtrapolatableLocalAssemblerCollection
 
class  Extrapolator
 
struct  FeHEX20
 
struct  FeHEX8
 
struct  FeLINE2
 
struct  FeLINE3
 
struct  FePOINT1
 
struct  FePRISM15
 
struct  FePRISM6
 
struct  FePYRA13
 
struct  FePYRA5
 
struct  FeQUAD4
 
struct  FeQUAD8
 
struct  FeQUAD9
 
struct  FeTET10
 
struct  FeTET4
 
struct  FeTRI3
 
struct  FeTRI6
 
class  FixedTimeStepping
 Fixed time stepping algorithm. More...
 
struct  FixedTimeSteppingParameters
 
class  FluxCorrectedTransport
 
struct  ForwardDifferencesStrategy
 
class  FullUpwind
 
struct  GaussLegendreIntegrationPolicy
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Point >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Prism >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Prism15 >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Pyramid >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Pyramid13 >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tet >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tet10 >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tri >
 
struct  GaussLegendreIntegrationPolicy< MeshLib::Tri6 >
 
class  GenericIntegrationMethod
 
struct  GlobalMatrixProvider
 
struct  GlobalVectorProvider
 
struct  IndexValueVector
 
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...
 
struct  IntegrationOrder
 
class  IntegrationPoint
 
class  IsotropicDiffusionStabilization
 
class  IterationNumberBasedTimeStepping
 Iteration number based adaptive time stepping. More...
 
struct  IterationNumberBasedTimeSteppingParameters
 
struct  LocalCouplingParameters
 
class  LocalLinearLeastSquaresExtrapolator
 
class  LocalToGlobalIndexMap
 
struct  LowerDim
 
struct  LowerDim< NumLib::ShapeHex20 >
 
struct  LowerDim< NumLib::ShapeLine3 >
 
struct  LowerDim< NumLib::ShapePrism15 >
 
struct  LowerDim< NumLib::ShapePyra13 >
 
struct  LowerDim< NumLib::ShapeQuad8 >
 
struct  LowerDim< NumLib::ShapeQuad9 >
 
struct  LowerDim< NumLib::ShapeTet10 >
 
struct  LowerDim< NumLib::ShapeTri6 >
 
class  MatrixProvider
 
class  MatrixTranslator
 
class  MatrixTranslator< ODESystemTag::FirstOrderImplicitQuasilinear >
 
class  MatrixTranslatorGeneral
 
class  MatrixTranslatorGeneral< ODESystemTag::FirstOrderImplicitQuasilinear >
 
class  MeshComponentMap
 Multidirectional mapping between mesh entities and degrees of freedom. More...
 
struct  NaturalCoordinates
 
struct  NaturalCoordinates< MeshLib::Hex >
 
struct  NaturalCoordinates< MeshLib::Hex20 >
 
struct  NaturalCoordinates< MeshLib::Line >
 
struct  NaturalCoordinates< MeshLib::Line3 >
 
struct  NaturalCoordinates< MeshLib::Point >
 
struct  NaturalCoordinates< MeshLib::Prism >
 
struct  NaturalCoordinates< MeshLib::Prism15 >
 
struct  NaturalCoordinates< MeshLib::Pyramid >
 
struct  NaturalCoordinates< MeshLib::Pyramid13 >
 
struct  NaturalCoordinates< MeshLib::Quad >
 
struct  NaturalCoordinates< MeshLib::Quad8 >
 
struct  NaturalCoordinates< MeshLib::Quad9 >
 
struct  NaturalCoordinates< MeshLib::Tet >
 
struct  NaturalCoordinates< MeshLib::Tet10 >
 
struct  NaturalCoordinates< MeshLib::Tri >
 
struct  NaturalCoordinates< MeshLib::Tri6 >
 
struct  NaturalCoordinatesMapping
 
class  NewtonRaphson
 
struct  NewtonRaphsonSolverParameters
 
class  NonlinearSolver
 
class  NonlinearSolver< NonlinearSolverTag::Newton >
 
class  NonlinearSolver< NonlinearSolverTag::Picard >
 
class  NonlinearSolverBase
 
struct  NonlinearSolverStatus
 Status of the non-linear solver. More...
 
class  NonlinearSystem
 
class  NonlinearSystem< NonlinearSolverTag::Newton >
 
class  NonlinearSystem< NonlinearSolverTag::Picard >
 
struct  NoStabilization
 
struct  NumericalDerivative
 
class  ODESystem
 
class  ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >
 
class  ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >
 
class  PETScNonlinearSolver
 
class  ReferenceElement
 
struct  RootCouplingNode
 
struct  SerialExecutor
 
class  ShapeHex20
 
class  ShapeHex8
 
class  ShapeLine2
 
class  ShapeLine3
 
struct  ShapeMatrices
 Coordinates mapping matrices at particular location. More...
 
class  ShapeMatrixCache
 
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  SimpleMatrixVectorProvider
 
class  StaggeredCoupling
 
class  TemplateIsoparametric
 Template class for isoparametric elements. More...
 
struct  Time
 
class  TimeDiscretization
 
class  TimeDiscretizedODESystem
 
class  TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >
 
class  TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >
 
class  TimeDiscretizedODESystemBase
 
struct  TimeIncrement
 
class  TimeStep
 Time step object. More...
 
class  TimeStepAlgorithm
 Interface of time stepping algorithms. More...
 
struct  Vectorial
 
class  VectorProvider
 

Typedefs

using AllElementTraitsLagrange
 
using RelativeEpsilon = BaseLib::StrongType<double, struct RelativeEpsilonTag>
 
using MinimumPerturbation
 
using NumericalStabilization
 
using CouplingNodeVariant = std::variant<CouplingNode, RootCouplingNode>
 
using RepeatDtPair = std::tuple<std::size_t, double>
 

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 { IterationResult::SUCCESS , IterationResult::FAILURE , IterationResult::REPEAT_ITERATION }
 Status flags telling the NonlinearSolver if an iteration succeeded. More...
 
enum class  NonlinearSolverTag : bool { NonlinearSolverTag::Picard , NonlinearSolverTag::Newton }
 Tag used to specify which nonlinear solver will be used. More...
 
enum class  ODESystemTag : char { ODESystemTag::FirstOrderImplicitQuasilinear , ODESystemTag::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.
 
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)
 
Eigen::VectorXd getLocalX (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x)
 
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 map_function)
 
template<typename Functor >
void transformVariableFromGlobalVector (GlobalVector const &input_vector_on_bulk_mesh, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector_on_submesh, std::vector< std::size_t > const &map_submesh_node_id_to_bulk_mesh_node_id, Functor map_function)
 
void cleanupGlobalMatrixProviders ()
 
template<typename... Ns_t, typename ElementDOFVector >
auto localDOF (ElementDOFVector const &x)
 
std::ostream & operator<< (std::ostream &os, LocalToGlobalIndexMap const &map)
 
GlobalIndexType getGlobalIndexWithTaylorHoodElement (MeshLib::NodePartitionedMesh const &partitioned_mesh, std::size_t const global_node_id, int const number_of_components_at_base_node, int const number_of_components_at_high_order_node, int const component_id_at_base_node, int const component_id_at_high_order_node, bool const is_base_node)
 
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)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Point, ShapePoint1)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Line, ShapeLine2)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Line3, ShapeLine3)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad, ShapeQuad4)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad8, ShapeQuad8)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad9, ShapeQuad9)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Hex, ShapeHex8)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Hex20, ShapeHex20)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tri, ShapeTri3)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tri6, ShapeTri6)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tet, ShapeTet4)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tet10, ShapeTet10)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Prism, ShapePrism6)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Prism15, ShapePrism15)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Pyramid, ShapePyra5)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Pyramid13, ShapePyra13)
 
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)
 
DefaultIntegrationMethodProvider getIntegrationMethodProvider (NumLib::IntegrationOrder const integration_order)
 
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)
 
template<typename MeshElementType , typename IPData , typename FluxVectorType , typename Derived >
void assembleAdvectionMatrix (NumericalStabilization const &stabilizer, IPData const &ip_data_vector, NumLib::ShapeMatrixCache const &shape_matrix_cache, std::vector< FluxVectorType > const &ip_flux_vector, double const average_velocity, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
template<typename IPData , typename FluxVectorType , typename Derived >
void assembleAdvectionMatrix (NumericalStabilization const &stabilizer, IPData const &ip_data_vector, std::vector< FluxVectorType > const &ip_flux_vector, double const average_velocity, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
NumericalStabilization createNumericalStabilization (MeshLib::Mesh const &mesh, BaseLib::ConfigTree const &config)
 
void computeFluxCorrectedTransport (NumericalStabilization const &stabilizer, const double t, const double dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, const MathLib::MatrixSpecifications &matrix_specification, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
 
Eigen::MatrixXd computeHydrodynamicDispersion (NumericalStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
 
std::unique_ptr< ConvergenceCriterioncreateConvergenceCriterion (BaseLib::ConfigTree const &config)
 Creates a convergence criterion from the given configuration.
 
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)
 
template<typename ProcessData >
void checkLocalCouplingParameters (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters)
 
template<typename ProcessData >
std::vector< CouplingNodeVariantcreateRegularCouplingNodes (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
 Create coupling nodes that do not have local-coupling nodes.
 
template<typename ProcessData >
std::vector< CouplingNodeVariantcreateRootCouplingNodes (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
 Create coupling nodes that have local-coupling nodes.
 
template<typename ProcessData >
std::vector< CouplingNodeVariantcreateCouplingNodes (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
 
template<typename ProcessData >
std::unique_ptr< StaggeredCouplingcreateStaggeredCoupling (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ProcessData > > const &per_process_data)
 Create a StaggeredCoupling instance from the given configuration.
 
std::vector< LocalCouplingParametersparseLocalCoupling (BaseLib::ConfigTree const &config, const std::size_t max_process_number)
 
std::tuple< std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > >, std::vector< LocalCouplingParameters >, int > parseCoupling (BaseLib::ConfigTree const &config)
 
EvolutionaryPIDcontrollerParameters parseEvolutionaryPIDcontroller (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateEvolutionaryPIDcontroller (EvolutionaryPIDcontrollerParameters const &config, std::vector< double > const &fixed_times_for_output)
 
FixedTimeSteppingParameters parseFixedTimeStepping (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateFixedTimeStepping (FixedTimeSteppingParameters const &parameters, std::vector< double > const &fixed_times_for_output)
 
IterationNumberBasedTimeSteppingParameters parseIterationNumberBasedTimeStepping (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateIterationNumberBasedTimeStepping (IterationNumberBasedTimeSteppingParameters &&parameters, std::vector< double > const &fixed_times_for_output)
 
std::size_t findDeltatInterval (Time const &t_initial, std::vector< double > const &delta_ts, Time const &fixed_output_time)
 
void incorporateFixedTimesForOutput (NumLib::Time const t_initial, NumLib::Time const t_end, std::vector< double > &delta_ts, std::vector< double > const &fixed_times_for_output)
 
double possiblyClampDtToNextFixedTime (Time const &t, double const dt, std::vector< double > const &fixed_output_times)
 
bool canReduceTimestepSize (TimeStep const &timestep_previous, TimeStep const &timestep_current, double const min_dt)
 
std::unique_ptr< TimeStepAlgorithmcreateTimeStepper (BaseLib::ConfigTree const &config, std::vector< double > const &fixed_times_for_output)
 
void updateTimeSteps (double const dt, TimeStep &previous_timestep, TimeStep &current_timestep)
 

Typedef Documentation

◆ AllElementTraitsLagrange

Initial value:
typename Map< MapFromTypeToType, List >::type Map_t
Definition TMP.h:102

Definition at line 100 of file ElementTraitsLagrange.h.

◆ CouplingNodeVariant

◆ MinimumPerturbation

◆ NumericalStabilization

Initial value:
std::variant<NoStabilization, IsotropicDiffusionStabilization, FullUpwind,
FluxCorrectedTransport>

Definition at line 31 of file CreateNumericalStabilization.h.

◆ RelativeEpsilon

using NumLib::RelativeEpsilon = BaseLib::StrongType<double, struct RelativeEpsilonTag>

Definition at line 21 of file NumericalDifferentiation.h.

◆ RepeatDtPair

using NumLib::RepeatDtPair = std::tuple<std::size_t, double>

Definition at line 22 of file FixedTimeStepping.h.

Enumeration Type Documentation

◆ ComponentOrder

enum class NumLib::ComponentOrder
strong

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{
26};
@ BY_LOCATION
Ordering data by spatial location.
@ BY_COMPONENT
Ordering data by component type.

◆ ShapeMatrixType

enum class NumLib::ShapeMatrixType
strong

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

◆ assembleAdvectionMatrix() [1/2]

template<typename MeshElementType , typename IPData , typename FluxVectorType , typename Derived >
void NumLib::assembleAdvectionMatrix ( NumericalStabilization const & stabilizer,
IPData const & ip_data_vector,
NumLib::ShapeMatrixCache const & shape_matrix_cache,
std::vector< FluxVectorType > const & ip_flux_vector,
double const average_velocity,
Eigen::MatrixBase< Derived > & laplacian_matrix )

Definition at line 109 of file AdvectionMatrixAssembler.h.

115{
116 std::visit(
117 [&](auto&& stabilizer)
118 {
119 using Stabilizer = std::decay_t<decltype(stabilizer)>;
120 if constexpr (std::is_same_v<Stabilizer, FullUpwind>)
121 {
122 if (average_velocity > stabilizer.getCutoffVelocity())
123 {
124 detail::applyFullUpwind(ip_data_vector, ip_flux_vector,
125 laplacian_matrix);
126 return;
127 }
128 }
129
130 detail::assembleAdvectionMatrix<MeshElementType>(
131 ip_data_vector, shape_matrix_cache, ip_flux_vector,
132 laplacian_matrix);
133 },
134 stabilizer);
135}

References NumLib::detail::applyFullUpwind(), and NumLib::detail::assembleAdvectionMatrix().

◆ assembleAdvectionMatrix() [2/2]

template<typename IPData , typename FluxVectorType , typename Derived >
void NumLib::assembleAdvectionMatrix ( NumericalStabilization const & stabilizer,
IPData const & ip_data_vector,
std::vector< FluxVectorType > const & ip_flux_vector,
double const average_velocity,
Eigen::MatrixBase< Derived > & laplacian_matrix )

Definition at line 138 of file AdvectionMatrixAssembler.h.

143{
144 std::visit(
145 [&](auto&& stabilizer)
146 {
147 using Stabilizer = std::decay_t<decltype(stabilizer)>;
148 if constexpr (std::is_same_v<Stabilizer, FullUpwind>)
149 {
150 if (average_velocity > stabilizer.getCutoffVelocity())
151 {
152 detail::applyFullUpwind(ip_data_vector, ip_flux_vector,
153 laplacian_matrix);
154 return;
155 }
156 }
157
158 detail::assembleAdvectionMatrix(
159 ip_data_vector, ip_flux_vector, laplacian_matrix);
160 },
161 stabilizer);
162}

References NumLib::detail::applyFullUpwind(), and NumLib::detail::assembleAdvectionMatrix().

◆ canReduceTimestepSize()

bool NumLib::canReduceTimestepSize ( TimeStep const & timestep_previous,
TimeStep const & timestep_current,
double const min_dt )

Definition at line 40 of file TimeStepAlgorithm.cpp.

43{
44 return !(timestep_current.dt() == min_dt &&
45 timestep_previous.dt() == min_dt);
46}

References NumLib::TimeStep::dt().

Referenced by NumLib::EvolutionaryPIDcontroller::canReduceTimestepSize(), and NumLib::IterationNumberBasedTimeStepping::canReduceTimestepSize().

◆ checkLocalCouplingParameters()

template<typename ProcessData >
void NumLib::checkLocalCouplingParameters ( std::vector< std::unique_ptr< ProcessData > > const & per_process_data,
std::vector< LocalCouplingParameters > const & all_local_coupling_parameters )

Definition at line 25 of file CreateStaggeredCoupling-impl.h.

28{
29 // Check whether the process names in the sub-coupling definitions exist in
30 // the process data.
31 for (auto const& local_coupling_parameters : all_local_coupling_parameters)
32 {
33 for (auto const& process_name : local_coupling_parameters.process_names)
34 {
35 if (std::none_of(
36 per_process_data.begin(),
37 per_process_data.end(),
38 [&process_name](auto const& process_data)
39 { return process_data->process_name == process_name; }))
40 {
42 "The given process name '{}' for the element "
43 "'time_loop/global_process_coupling/"
44 "local_coupling_processes/process_name' is not found "
45 "in the element 'time_loop/global_process_coupling/"
46 "local_coupling_processes/process_name' in the project "
47 "file.",
48 process_name);
49 }
50 }
51 }
52}
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

Referenced by createCouplingNodes().

◆ 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 29 of file GlobalMatrixProviders.cpp.

30{
32}
static std::unique_ptr< NumLib::SimpleMatrixVectorProvider > globalSetupGlobalMatrixVectorProvider

References globalSetupGlobalMatrixVectorProvider.

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

◆ computeFluxCorrectedTransport()

void NumLib::computeFluxCorrectedTransport ( NumericalStabilization const & stabilizer,
const double t,
const double dt,
std::vector< GlobalVector * > const & x,
std::vector< GlobalVector * > const & x_prev,
int const process_id,
const MathLib::MatrixSpecifications & matrix_specification,
GlobalMatrix & M,
GlobalMatrix & K,
GlobalVector & b )
inline

Definition at line 211 of file FluxCorrectedTransport.h.

217{
218 // if needed, calling the Flux-Corrected-Transport function
219 return std::visit(
220 [&](auto&& stabilizer)
221 {
222 using Stabilizer = std::decay_t<decltype(stabilizer)>;
223 if constexpr (std::is_same_v<Stabilizer,
225 {
226 return detail::calculateFluxCorrectedTransport(
227 t, dt, x, x_prev, process_id, matrix_specification, M, K,
228 b);
229 }
230 },
231 stabilizer);
232}

References NumLib::detail::calculateFluxCorrectedTransport().

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::assembleConcreteProcess().

◆ computeHydrodynamicDispersion()

Eigen::MatrixXd NumLib::computeHydrodynamicDispersion ( NumericalStabilization const & stabilizer,
std::size_t const element_id,
Eigen::MatrixXd const & pore_diffusion_coefficient,
Eigen::VectorXd const & velocity,
double const porosity,
double const solute_dispersivity_transverse,
double const solute_dispersivity_longitudinal )
inline

Definition at line 71 of file HydrodynamicDispersion.h.

79{
80 return std::visit(
81 [&](auto&& stabilizer)
82 {
83 using Stabilizer = std::decay_t<decltype(stabilizer)>;
84 if constexpr (std::is_same_v<Stabilizer,
86 {
87 return detail::getHydrodynamicDispersionWithArtificialDiffusion(
88 stabilizer,
89 element_id,
90 pore_diffusion_coefficient,
91 velocity,
92 porosity,
93 solute_dispersivity_transverse,
94 solute_dispersivity_longitudinal);
95 }
96
97 return detail::getHydrodynamicDispersion(
98 pore_diffusion_coefficient,
99 velocity,
100 porosity,
101 solute_dispersivity_transverse,
102 solute_dispersivity_longitudinal);
103 },
104 stabilizer);
105}

References NumLib::detail::getHydrodynamicDispersion(), and NumLib::detail::getHydrodynamicDispersionWithArtificialDiffusion().

Referenced by ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleBlockMatrices(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleComponentTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobianComponentTransportEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtMolarFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getThermalConductivityDispersivity(), and ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations().

◆ 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 25 of file InitShapeMatrices.h.

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

References createIsoparametricFiniteElement().

Referenced by ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, LowerOrderShapeFunction, GlobalDim >::computeLowerOrderShapeMatrix(), NumLib::TemplateIsoparametric< ShapeFunctionType_, ShapeMatrixTypes_ >::computeShapeFunctions(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::getFlux(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, 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 {
31 }
32 if (type == "Residual")
33 {
34 return createConvergenceCriterionResidual(config);
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}
T peekConfigParameter(std::string const &param) const
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().

◆ 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}
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
VecNormType convertStringToVecNormType(const std::string &str)
convert string to VecNormType

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().

◆ createCouplingNodes()

template<typename ProcessData >
std::vector< CouplingNodeVariant > NumLib::createCouplingNodes ( std::vector< std::unique_ptr< ProcessData > > const & per_process_data,
std::vector< LocalCouplingParameters > const & all_local_coupling_parameters,
int const global_max_coupling_iterations,
std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > & global_coupling_conv_criteria )

Definition at line 145 of file CreateStaggeredCoupling-impl.h.

151{
152 checkLocalCouplingParameters(per_process_data,
153 all_local_coupling_parameters);
154
155 // First, get the coupling nodes that do not have local-coupling nodes.
156 std::vector<CouplingNodeVariant> coupling_nodes =
158 per_process_data, all_local_coupling_parameters,
159 global_max_coupling_iterations, global_coupling_conv_criteria);
160
161 // Second, get the coupling nodes that have local-coupling nodes.
162 std::vector<CouplingNodeVariant> root_coupling_nodes =
163 createRootCouplingNodes(per_process_data, all_local_coupling_parameters,
164 global_max_coupling_iterations,
165 global_coupling_conv_criteria);
166
167 std::size_t const num_coupling_nodes =
168 coupling_nodes.size() +
169 std::accumulate(
170 root_coupling_nodes.begin(),
171 root_coupling_nodes.end(),
172 0,
173 [](std::size_t accumulated_sizes, const auto& coupling_node)
174 {
175 return accumulated_sizes +
176 std::get<RootCouplingNode>(coupling_node)
177 .sub_coupling_nodes.size();
178 });
179
180 if (num_coupling_nodes != per_process_data.size())
181 {
182 OGS_FATAL(
183 "The number of all coupling nodes including sub-nodes is not "
184 "identical to the number of the processes! Please check the "
185 "element by tag global_process_coupling in the project file.");
186 }
187
188 if (coupling_nodes.empty())
189 {
190 coupling_nodes = std::move(root_coupling_nodes);
191 }
192 else
193 {
194 coupling_nodes.reserve(coupling_nodes.size() +
195 root_coupling_nodes.size());
196
197 std::move(std::begin(root_coupling_nodes),
198 std::end(root_coupling_nodes),
199 std::back_inserter(coupling_nodes));
200 }
201
202 return coupling_nodes;
203}
void checkLocalCouplingParameters(std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters)
std::vector< CouplingNodeVariant > createRootCouplingNodes(std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
Create coupling nodes that have local-coupling nodes.
std::vector< CouplingNodeVariant > createRegularCouplingNodes(std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
Create coupling nodes that do not have local-coupling nodes.

References checkLocalCouplingParameters(), createRegularCouplingNodes(), createRootCouplingNodes(), and OGS_FATAL.

Referenced by createStaggeredCoupling().

◆ createEvolutionaryPIDcontroller()

std::unique_ptr< TimeStepAlgorithm > NumLib::createEvolutionaryPIDcontroller ( EvolutionaryPIDcontrollerParameters const & config,
std::vector< double > const & fixed_times_for_output )

Create an EvolutionaryPIDcontroller time stepper from the given configuration

Definition at line 52 of file CreateEvolutionaryPIDcontroller.cpp.

55{
56 if (config.t_end < config.t0)
57 {
59 "Evolutionary PID controller timestepping: end time ({}) is "
60 "smaller than initial time ({})",
61 config.t_end,
62 config.t0);
63 }
64
65 return std::make_unique<EvolutionaryPIDcontroller>(config.t0,
66 config.t_end,
67 config.h0,
68 config.h_min,
69 config.h_max,
70 config.rel_h_min,
71 config.rel_h_max,
72 config.tol,
73 fixed_times_for_output);
74}

References NumLib::EvolutionaryPIDcontrollerParameters::h0, NumLib::EvolutionaryPIDcontrollerParameters::h_max, NumLib::EvolutionaryPIDcontrollerParameters::h_min, OGS_FATAL, NumLib::EvolutionaryPIDcontrollerParameters::rel_h_max, NumLib::EvolutionaryPIDcontrollerParameters::rel_h_min, NumLib::EvolutionaryPIDcontrollerParameters::t0, NumLib::EvolutionaryPIDcontrollerParameters::t_end, and NumLib::EvolutionaryPIDcontrollerParameters::tol.

Referenced by createTimeStepper().

◆ createFixedTimeStepping()

std::unique_ptr< TimeStepAlgorithm > NumLib::createFixedTimeStepping ( FixedTimeSteppingParameters const & parameters,
std::vector< double > const & fixed_times_for_output )

Definition at line 86 of file CreateFixedTimeStepping.cpp.

89{
90 if (parameters.t_end < parameters.t_initial)
91 {
93 "fixed timestepping: end time ({}) is smaller than initial time "
94 "({})",
95 parameters.t_end,
96 parameters.t_initial);
97 }
98
99 if (!FixedTimeStepping::areRepeatDtPairsValid(parameters.repeat_dt_pairs))
100 {
101 OGS_FATAL(
102 "CreateFixedTimeStepping: invalid specification of (repeat, "
103 "delta_t) pairs");
104 }
105
106 return std::make_unique<FixedTimeStepping>(parameters.t_initial,
107 parameters.t_end,
108 parameters.repeat_dt_pairs,
109 fixed_times_for_output);
110}

References NumLib::FixedTimeStepping::areRepeatDtPairsValid(), OGS_FATAL, NumLib::FixedTimeSteppingParameters::repeat_dt_pairs, NumLib::FixedTimeSteppingParameters::t_end, and NumLib::FixedTimeSteppingParameters::t_initial.

Referenced by createTimeStepper().

◆ createIsoparametricFiniteElement()

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

◆ createIterationNumberBasedTimeStepping()

std::unique_ptr< TimeStepAlgorithm > NumLib::createIterationNumberBasedTimeStepping ( IterationNumberBasedTimeSteppingParameters && parameters,
std::vector< double > const & fixed_times_for_output )

Create a IterationNumberBasedTimeStepping time stepper from the given configuration.

Definition at line 66 of file CreateIterationNumberBasedTimeStepping.cpp.

69{
70 if (parameters.t_end < parameters.t_initial)
71 {
73 "iteration number based timestepping: end time ({}) is smaller "
74 "than initial time ({})",
75 parameters.t_end,
76 parameters.t_initial);
77 }
78
79 return std::make_unique<IterationNumberBasedTimeStepping>(
80 parameters.t_initial, parameters.t_end, parameters.minimum_dt,
81 parameters.maximum_dt, parameters.initial_dt,
82 std::move(parameters.number_iterations),
83 std::move(parameters.multiplier), fixed_times_for_output);
84}

References OGS_FATAL.

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(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40

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().

◆ createNumericalStabilization()

NumericalStabilization NumLib::createNumericalStabilization ( MeshLib::Mesh const & mesh,
BaseLib::ConfigTree const & config )
Input File Parameter
prj__processes__process__numerical_stabilization
Input File Parameter
prj__processes__process__numerical_stabilization__type
Input File Parameter
prj__processes__process__numerical_stabilization__IsotropicDiffusion__cutoff_velocity
Input File Parameter
prj__processes__process__numerical_stabilization__IsotropicDiffusion__tuning_parameter
Input File Parameter
prj__processes__process__numerical_stabilization__FullUpwind__cutoff_velocity

Definition at line 20 of file CreateNumericalStabilization.cpp.

22{
23 auto const stabilization_config =
25 config.getConfigSubtreeOptional("numerical_stabilization");
26 if (!stabilization_config)
27 {
28 return NoStabilization{};
29 }
30
31 auto const type =
33 stabilization_config->getConfigParameter<std::string>("type");
34
35 INFO("Using {:s} numerical stabilization.", type);
36 if (type == "IsotropicDiffusion")
37 {
38 auto const cutoff_velocity =
40 stabilization_config->getConfigParameter<double>("cutoff_velocity");
41
42 auto const tuning_parameter =
44 stabilization_config->getConfigParameter<double>(
45 "tuning_parameter");
46
47 return IsotropicDiffusionStabilization{
48 cutoff_velocity, tuning_parameter,
49 MeshLib::getMaxiumElementEdgeLengths(mesh.getElements())};
50 }
51 if (type == "FullUpwind")
52 {
53 auto const cutoff_velocity =
55 stabilization_config->getConfigParameter<double>("cutoff_velocity");
56
57 return FullUpwind{cutoff_velocity};
58 }
59 if (type == "FluxCorrectedTransport")
60 {
61 return FluxCorrectedTransport();
62 }
63
64 OGS_FATAL("The stabilization type {:s} is not available.", type);
65}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
std::vector< double > getMaxiumElementEdgeLengths(std::vector< Element * > const &elements)
Returns the maximum lengths of the edges for each element.

References BaseLib::ConfigTree::getConfigSubtreeOptional(), MeshLib::Mesh::getElements(), MeshLib::getMaxiumElementEdgeLengths(), INFO(), and OGS_FATAL.

Referenced by ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HT::createHTProcess(), and ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess().

◆ createRegularCouplingNodes()

template<typename ProcessData >
std::vector< CouplingNodeVariant > NumLib::createRegularCouplingNodes ( std::vector< std::unique_ptr< ProcessData > > const & per_process_data,
std::vector< LocalCouplingParameters > const & all_local_coupling_parameters,
int const global_max_coupling_iterations,
std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > & global_coupling_conv_criteria )

Create coupling nodes that do not have local-coupling nodes.

Definition at line 56 of file CreateStaggeredCoupling-impl.h.

62{
63 std::vector<CouplingNodeVariant> coupling_nodes;
64
65 for (auto const& process_data : per_process_data)
66 {
67 auto const& process_name = process_data->process_name;
68
69 // If process_data->process_name occurs in local_coupling_parameters
70 // do nothing
71 if (std::any_of(
72 all_local_coupling_parameters.begin(),
73 all_local_coupling_parameters.end(),
74 [&process_name](auto const& local_coupling_parameters)
75 {
76 auto const& process_names =
77 local_coupling_parameters.process_names;
78 return std::find(process_names.begin(), process_names.end(),
79 process_name) != process_names.end();
80 }))
81 {
82 continue;
83 }
84
85 std::string const used_process_name =
86 process_name.empty() ? "not given" : process_name;
87 CouplingNode regular_node{
88 used_process_name,
89 std::move(global_coupling_conv_criteria[process_data->process_id]),
90 global_max_coupling_iterations,
91 process_data->process_id,
92 };
93 coupling_nodes.emplace_back(std::move(regular_node));
94 }
95
96 return coupling_nodes;
97}

References NumLib::CouplingNode::process_id.

Referenced by createCouplingNodes().

◆ createRootCouplingNodes()

template<typename ProcessData >
std::vector< CouplingNodeVariant > NumLib::createRootCouplingNodes ( std::vector< std::unique_ptr< ProcessData > > const & per_process_data,
std::vector< LocalCouplingParameters > const & all_local_coupling_parameters,
int const global_max_coupling_iterations,
std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > & global_coupling_conv_criteria )

Create coupling nodes that have local-coupling nodes.

Definition at line 101 of file CreateStaggeredCoupling-impl.h.

107{
108 std::vector<CouplingNodeVariant> coupling_nodes;
109
110 for (auto const& local_coupling_parameters : all_local_coupling_parameters)
111 {
112 RootCouplingNode root_node = {global_max_coupling_iterations, {}};
113
114 for (auto const& local_process_name :
115 local_coupling_parameters.process_names)
116 {
117 if (auto it = std::find_if(
118 per_process_data.begin(),
119 per_process_data.end(),
120 [&local_process_name](auto const& process_data) {
121 return process_data->process_name == local_process_name;
122 });
123 it != per_process_data.end())
124 {
125 auto const& process_data = *it;
126
127 CouplingNode regular_node{
128 process_data->process_name,
129 std::move(global_coupling_conv_criteria[process_data
130 ->process_id]),
131 local_coupling_parameters.max_iterations,
132 process_data->process_id};
133
134 root_node.sub_coupling_nodes.emplace_back(
135 std::move(regular_node));
136 }
137 }
138 coupling_nodes.emplace_back(std::move(root_node));
139 }
140
141 return coupling_nodes;
142}
std::vector< CouplingNodeVariant > sub_coupling_nodes

References NumLib::CouplingNode::process_name, and NumLib::RootCouplingNode::sub_coupling_nodes.

Referenced by createCouplingNodes().

◆ createStaggeredCoupling()

template<typename ProcessData >
std::unique_ptr< StaggeredCoupling > NumLib::createStaggeredCoupling ( BaseLib::ConfigTree const & config,
std::vector< std::unique_ptr< ProcessData > > const & per_process_data )

Create a StaggeredCoupling instance from the given configuration.

Definition at line 207 of file CreateStaggeredCoupling-impl.h.

210{
211 auto [global_coupling_conv_criteria, all_local_coupling_parameters,
212 max_coupling_iterations] = parseCoupling(config);
213
214 if (per_process_data.size() != global_coupling_conv_criteria.size())
215 {
216 OGS_FATAL(
217 "The number of convergence criteria of the global "
218 "staggered coupling loop is not identical to the number of the "
219 "processes! Please check the element by tag "
220 "global_process_coupling in the project file.");
221 }
222
223 auto coupling_nodes = createCouplingNodes(
224 per_process_data, all_local_coupling_parameters,
225 max_coupling_iterations, global_coupling_conv_criteria);
226
227 return std::make_unique<StaggeredCoupling>(max_coupling_iterations,
228 std::move(coupling_nodes));
229}
std::tuple< std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > >, std::vector< LocalCouplingParameters >, int > parseCoupling(BaseLib::ConfigTree const &config)

References createCouplingNodes(), OGS_FATAL, and parseCoupling().

Referenced by ProcessLib::createTimeLoop().

◆ 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,
std::vector< double > const & fixed_times_for_output )
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.

29{
31 auto const type = config.peekConfigParameter<std::string>("type");
32
33 if (type == "SingleStep")
34 {
36 config.ignoreConfigParameter("type");
37 return std::make_unique<NumLib::FixedTimeStepping>(0.0, 1.0, 1.0);
38 }
39 if (type == "FixedTimeStepping")
40 {
41 return NumLib::createFixedTimeStepping(parseFixedTimeStepping(config),
42 fixed_times_for_output);
43 }
44 if (type == "EvolutionaryPIDcontroller")
45 {
47 parseEvolutionaryPIDcontroller(config), fixed_times_for_output);
48 }
49 if (type == "IterationNumberBasedTimeStepping")
50 {
53 fixed_times_for_output);
54 }
56 "Unknown time stepping type: '{:s}'. The available types are: "
57 "\n\tSingleStep,"
58 "\n\tFixedTimeStepping,"
59 "\n\tEvolutionaryPIDcontroller,",
60 "\n\tIterationNumberBasedTimeStepping\n",
61 type.data());
62}
std::unique_ptr< TimeStepAlgorithm > createEvolutionaryPIDcontroller(EvolutionaryPIDcontrollerParameters const &config, std::vector< double > const &fixed_times_for_output)
EvolutionaryPIDcontrollerParameters parseEvolutionaryPIDcontroller(BaseLib::ConfigTree const &config)
IterationNumberBasedTimeSteppingParameters parseIterationNumberBasedTimeStepping(BaseLib::ConfigTree const &config)
std::unique_ptr< TimeStepAlgorithm > createFixedTimeStepping(FixedTimeSteppingParameters const &parameters, std::vector< double > const &fixed_times_for_output)
std::unique_ptr< TimeStepAlgorithm > createIterationNumberBasedTimeStepping(IterationNumberBasedTimeSteppingParameters &&parameters, std::vector< double > const &fixed_times_for_output)

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

Referenced by ProcessLib::createPerProcessData().

◆ findDeltatInterval()

std::size_t NumLib::findDeltatInterval ( Time const & t_initial,
std::vector< double > const & delta_ts,
Time const & fixed_output_time )

Definition at line 54 of file FixedTimeStepping.cpp.

57{
58 if (fixed_output_time < t_initial)
59 {
60 return std::numeric_limits<std::size_t>::max();
61 }
62
63 auto timestepper_time = t_initial;
64 for (std::size_t k = 0; k < delta_ts.size(); ++k)
65 {
66 if (timestepper_time <= fixed_output_time &&
67 fixed_output_time < timestepper_time + delta_ts[k])
68 {
69 return k;
70 }
71 timestepper_time += delta_ts[k];
72 }
73
74 return std::numeric_limits<std::size_t>::max();
75}

Referenced by incorporateFixedTimesForOutput().

◆ getGlobalIndexWithTaylorHoodElement()

GlobalIndexType NumLib::getGlobalIndexWithTaylorHoodElement ( MeshLib::NodePartitionedMesh const & partitioned_mesh,
std::size_t const global_node_id,
int const number_of_components_at_base_node,
int const number_of_components_at_high_order_node,
int const component_id_at_base_node,
int const component_id_at_high_order_node,
bool const is_base_node )

Definition at line 323 of file MeshComponentMap.cpp.

331{
332 int const partition_id = partitioned_mesh.getPartitionID(global_node_id);
333
334 auto const n_total_active_base_nodes_before_this_rank =
335 partitioned_mesh.getNumberOfRegularBaseNodesAtRank(partition_id);
336
337 auto const n_total_active_high_order_nodes_before_this_rank =
338 partitioned_mesh.getNumberOfRegularHighOrderNodesAtRank(partition_id);
339
340 auto const node_id_offset =
341 n_total_active_base_nodes_before_this_rank +
342 n_total_active_high_order_nodes_before_this_rank;
343
344 auto const index_offset = n_total_active_base_nodes_before_this_rank *
345 number_of_components_at_base_node +
346 n_total_active_high_order_nodes_before_this_rank *
347 number_of_components_at_high_order_node;
348
349 if (is_base_node)
350 {
351 return static_cast<GlobalIndexType>(
352 index_offset + (global_node_id - node_id_offset) *
353 number_of_components_at_base_node) +
354 component_id_at_base_node;
355 }
356
357 int const n_active_base_nodes_of_this_partition =
358 partitioned_mesh.getNumberOfRegularBaseNodesAtRank(partition_id + 1) -
359 n_total_active_base_nodes_before_this_rank;
360
361 /*
362 The global indices of components are numbered as what depicted below by
363 assuming that the base node has three components and the high order node
364 has two components:
365
366 Partition | 0 | 1 | ...
367 --------------------------------
368 Regular nodes | Base | higher | Base | higher| ...
369 --------------------------------
370 c0 x x x x ...
371 c1 x x x x ...
372 c2 x x ...
373 */
374 return static_cast<GlobalIndexType>(
375 index_offset +
376 n_active_base_nodes_of_this_partition *
377 number_of_components_at_base_node +
378 (global_node_id - node_id_offset -
379 n_active_base_nodes_of_this_partition) *
380 number_of_components_at_high_order_node) +
381 component_id_at_high_order_node;
382}
GlobalMatrix::IndexType GlobalIndexType

References MeshLib::NodePartitionedMesh::getNumberOfRegularBaseNodesAtRank(), MeshLib::NodePartitionedMesh::getNumberOfRegularHighOrderNodesAtRank(), and MeshLib::NodePartitionedMesh::getPartitionID().

Referenced by NumLib::MeshComponentMap::createParallelMeshComponentMap().

◆ 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 120 of file DOFTableUtil.cpp.

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

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

Referenced by ProcessLib::BoundaryConditionAndSourceTerm::Python::BcAndStLocalAssemblerImpl< BcOrStData, ShapeFunction, LowerOrderShapeFunction, GlobalDim >::assemble(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::VariableDependentNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::VectorMatrixAssembler::assemble(), ProcessLib::WellboreCompensateNeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::assembleReactionEquation(), ProcessLib::VectorMatrixAssembler::assembleWithJacobian(), anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::assembleWithJacobianForStaggeredSchemeOneElement(), anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::assembleWithJacobianOneElement(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::computeCrackIntegral(), ProcessLib::LocalAssemblerInterface::computeSecondaryVariable(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtDarcyVelocity(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::TES::TESLocalAssembler< ShapeFunction_, GlobalDim >::getIntPtDarcyVelocity(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtHeatFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtMolarFlux(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtSaturation(), getLocalX(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::initializeChemicalSystem(), ProcessLib::AnchorTerm< GlobalDim >::integrate(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, GlobalDim >::integrate(), ProcessLib::VectorMatrixAssembler::preAssemble(), ProcessLib::LocalAssemblerInterface::preTimestep(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::setChemicalSystem(), and ProcessLib::SmallDeformation::writeMaterialForces().

◆ getIntegrationMethodProvider()

DefaultIntegrationMethodProvider NumLib::getIntegrationMethodProvider ( NumLib::IntegrationOrder const integration_order)
inline

Used in template functions to get the DefaultIntegrationMethodProvider for the given integration_order.

Definition at line 55 of file IntegrationMethodProvider.h.

◆ getLocalX()

Eigen::VectorXd NumLib::getLocalX ( std::size_t const mesh_item_id,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_tables,
std::vector< GlobalVector * > const & x )

Definition at line 176 of file DOFTableUtil.cpp.

180{
181 Eigen::VectorXd local_x_vec;
182
183 auto const n_processes = x.size();
184 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
185 {
186 auto const indices =
187 NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
188 assert(!indices.empty());
189 auto const last = local_x_vec.size();
190 local_x_vec.conservativeResize(last + indices.size());
191 auto const local_solution = x[process_id]->get(indices);
192 assert(indices.size() == local_solution.size());
193 local_x_vec.tail(local_solution.size()).noalias() =
194 MathLib::toVector(local_solution);
195 }
196 return local_x_vec;
197}
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)

References getIndices(), and MathLib::toVector().

Referenced by ProcessLib::LocalAssemblerInterface::computeSecondaryVariable(), ProcessLib::LocalAssemblerInterface::postNonLinearSolver(), ProcessLib::LocalAssemblerInterface::postTimestep(), and ProcessLib::LocalAssemblerInterface::setInitialConditions().

◆ 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 106 of file DOFTableUtil.cpp.

110{
112 node_id};
113
114 auto const index = dof_table.getGlobalIndex(l, global_component_id);
115 assert(index != NumLib::MeshComponentMap::nop);
116
117 return x.get(index);
118}
static constexpr 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 87 of file DOFTableUtil.cpp.

91{
93 node_id};
94
95 auto const index = dof_table.getGlobalIndex(l, global_component_id);
96 assert(index != NumLib::MeshComponentMap::nop);
97
98 if (index < 0)
99 { // ghost node value
100 return 0.0;
101 }
102
103 return x.get(index);
104}

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 139 of file DOFTableUtil.cpp.

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

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

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

◆ incorporateFixedTimesForOutput()

void NumLib::incorporateFixedTimesForOutput ( NumLib::Time const t_initial,
NumLib::Time const t_end,
std::vector< double > & delta_ts,
std::vector< double > const & fixed_times_for_output )

Definition at line 77 of file FixedTimeStepping.cpp.

81{
82 if (fixed_times_for_output.empty())
83 {
84 return;
85 }
86
87 if (auto lower_bound = std::lower_bound(
88 begin(fixed_times_for_output), end(fixed_times_for_output),
89 t_initial,
90 [](auto const time, NumLib::Time const& initial_time)
91 { return NumLib::Time(time) < initial_time; });
92 lower_bound != begin(fixed_times_for_output))
93 {
94 WARN(
95 "Request for output at times {}, but the simulation's start time "
96 "is {}. Output will be skipped.",
97 fmt::join(begin(fixed_times_for_output), lower_bound, ", "),
98 t_initial());
99 }
100
101 if (auto upper_bound =
102 std::upper_bound(begin(fixed_times_for_output),
103 end(fixed_times_for_output), t_end());
104 upper_bound != end(fixed_times_for_output))
105 {
106 WARN(
107 "Request for output at times {}, but simulation's end time is {}. "
108 "Output will be skipped.",
109 fmt::join(upper_bound, end(fixed_times_for_output), ", "),
110 t_end());
111 }
112
113 if (delta_ts.empty())
114 {
115 WARN("No timesteps specified.");
116 return;
117 }
118
119 // incorporate fixed output times into dts vector
120 for (auto const fixed_time_for_output : fixed_times_for_output)
121 {
122 auto const interval_number = findDeltatInterval(
123 t_initial, delta_ts, Time(fixed_time_for_output));
124 if (interval_number == std::numeric_limits<std::size_t>::max())
125 {
126 WARN("Did not find interval for fixed output time {}",
127 fixed_time_for_output);
128 continue;
129 }
130
131 auto const lower_bound = std::accumulate(
132 begin(delta_ts), begin(delta_ts) + interval_number, t_initial);
133 auto const upper_bound = lower_bound + delta_ts[interval_number];
134 // in order to use the comparison from struct Time
135 if (NumLib::Time(fixed_time_for_output) == lower_bound)
136 {
137 continue;
138 }
139 if (upper_bound == NumLib::Time(fixed_time_for_output))
140 {
141 continue;
142 }
143 delta_ts[interval_number] = fixed_time_for_output - lower_bound();
144
145 delta_ts.insert(delta_ts.begin() + interval_number + 1,
146 upper_bound() - fixed_time_for_output);
147 }
148}
std::size_t findDeltatInterval(Time const &t_initial, std::vector< double > const &delta_ts, Time const &fixed_output_time)

References findDeltatInterval(), and WARN().

Referenced by NumLib::FixedTimeStepping::FixedTimeStepping().

◆ 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<MathLib::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}

References computeShapeMatrices().

Referenced by ProcessLib::ConstraintDirichletBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::ConstraintDirichletBoundaryConditionLocalAssembler(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::HeatTransportBHELocalAssemblerSoil(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::HTFEM(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerMatrix(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::LargeDeformationLocalAssembler(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::LiquidFlowLocalAssembler(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::LocalAssemblerData(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >::LocalAssemblerData(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::PhaseFieldLocalAssembler(), NumLib::ShapeMatrixCache::ShapeMatrixCache(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerMatrixNearFracture(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::SmallDeformationNonlocalLocalAssembler(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::SurfaceFluxLocalAssembler(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::TH2MLocalAssembler(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::ThermalTwoPhaseFlowWithPPLocalAssembler(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ThermoHydroMechanicsLocalAssembler(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicalPhaseFieldLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::ThermoRichardsMechanicsLocalAssembler(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::TwoPhaseFlowWithPPLocalAssembler(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, GlobalDim >::VolumetricSourceTermLocalAssembler(), ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::WellboreSimulatorFEM(), MeshToolsLib::computeElementVolumeNumerically(), ProcessLib::BoundaryConditionAndSourceTerm::Python::computeNsAndWeights(), ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::initNsAndWeights(), and anonymous_namespace{ShapeMatrixCache.cpp}::initShapeMatrices().

◆ 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 createIsoparametricFiniteElement(), and N.

Referenced by ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::computeSecondaryVariableConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::initializeConcrete(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, GlobalDim >::integrate(), interpolateElementCoords(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariablesDerivatives().

◆ 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 107 of file Interpolation.h.

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

Referenced by ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::computeSecondaryVariableConcrete(), and ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, 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 createIsoparametricFiniteElement(), and N.

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::assembleBlockMatricesWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianPhaseFieldEquations(), ProcessLib::LinearBMatrix::computeDilatationalBbar(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformation::getMaterialForces(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::getNodalValues(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postNonLinearSolverConcrete(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::postTimestepConcreteWithBlockVectors(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::preAssemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables().

◆ localDOF()

template<typename... Ns_t, typename ElementDOFVector >
auto NumLib::localDOF ( ElementDOFVector const & x)

Decomposes the passed d.o.f.s of an entire finite element into d.o.f.s belonging to individual unknowns—such as pressure, temperature, or displacement—via the passed shape functions.

Attention
The order of the passed shape functions indicates the order of the primary unknowns in the element d.o.f.s, and the order of the returned data, i.e., the order is important!
Returns
a std::tuple of mapped d.o.f. data (cf. Eigen::Map)

Definition at line 64 of file LocalDOF.h.

65{
66 using namespace boost::mp11;
67
68 static_assert(sizeof...(Ns_t) > 0);
69
70 using Sizes = mp_list_c<int, detail::NumberOfDofs<Ns_t>::value...>;
71 using Offsets =
72 mp_push_front<mp_pop_back<mp_partial_sum<Sizes, mp_int<0>, mp_plus>>,
73 mp_int<0>>;
74
75 assert((mp_back<Offsets>::value + mp_back<Sizes>::value == x.size()) &&
76 "The passed shape matrices require a different number of "
77 "d.o.f.s than present in the passed element d.o.f. vector.");
78
79 return detail::localDOFImpl<Ns_t...>(x, Offsets{}, Sizes{});
80}

References NumLib::detail::localDOFImpl().

Referenced by ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::localDOF(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::localDOF(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::localDOF(), and ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::localDOF().

◆ 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.

Referenced by 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 159 of file DOFTableUtil.cpp.

162{
163 switch (norm_type)
164 {
166 return norm1(x, global_component, dof_table, mesh);
168 return norm2(x, global_component, dof_table, mesh);
170 return normInfinity(x, global_component, dof_table, mesh);
171 default:
172 OGS_FATAL("An invalid norm type has been passed.");
173 }
174}

References MathLib::INFINITY_N, MathLib::NORM1, MathLib::NORM2, 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().

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [1/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Hex ,
ShapeHex8  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [2/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Hex20 ,
ShapeHex20  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [3/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Line ,
ShapeLine2  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [4/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Line3 ,
ShapeLine3  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [5/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Point ,
ShapePoint1  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [6/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Prism ,
ShapePrism6  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [7/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Prism15 ,
ShapePrism15  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [8/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Pyramid ,
ShapePyra5  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [9/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Pyramid13 ,
ShapePyra13  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [10/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Quad ,
ShapeQuad4  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [11/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Quad8 ,
ShapeQuad8  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [12/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Quad9 ,
ShapeQuad9  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [13/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tet ,
ShapeTet4  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [14/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tet10 ,
ShapeTet10  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [15/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tri ,
ShapeTri3  )

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [16/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tri6 ,
ShapeTri6  )

◆ 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}
void write(std::ostream &out) const

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 441 of file LocalToGlobalIndexMap.cpp.

442{
443 std::size_t const max_lines = 10;
444 std::size_t lines_printed = 0;
445
446 os << "Rows of the local to global index map; " << map._rows.size()
447 << " rows\n";
448 for (std::size_t e = 0; e < map.size(); ++e)
449 {
450 os << "== e " << e << " ==\n";
451 for (int c = 0; c < map.getNumberOfGlobalComponents(); ++c)
452 {
453 auto const& line = map._rows(e, c);
454
455 os << "c" << c << " { ";
456 std::copy(line.cbegin(), line.cend(),
457 std::ostream_iterator<std::size_t>(os, " "));
458 os << " }\n";
459 }
460
461 if (lines_printed++ > max_lines)
462 {
463 os << "...\n";
464 break;
465 }
466 }
467
468 os << "Mesh component map:\n" << map._mesh_component_map;
469 return os;
470}

◆ parseCoupling()

std::tuple< std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > >, std::vector< LocalCouplingParameters >, int > NumLib::parseCoupling ( BaseLib::ConfigTree const & config)
Input File Parameter
prj__time_loop__global_process_coupling
Input File Parameter
prj__time_loop__global_process_coupling__max_iter
Input File Parameter
prj__time_loop__global_process_coupling__convergence_criteria
Input File Parameter
prj__time_loop__global_process_coupling__convergence_criteria__convergence_criterion

Definition at line 105 of file CreateStaggeredCoupling.cpp.

106{
107 auto const& coupling_config
109 = config.getConfigSubtreeOptional("global_process_coupling");
110
111 std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>
112 global_coupling_conv_criteria;
113
114 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
115
116 int max_coupling_iterations = 1;
117 if (coupling_config)
118 {
119 max_coupling_iterations
121 = coupling_config->getConfigParameter<int>("max_iter");
122
123 auto const& coupling_convergence_criteria_config =
125 coupling_config->getConfigSubtree("convergence_criteria");
126
127 auto coupling_convergence_criterion_config =
129 coupling_convergence_criteria_config.getConfigSubtreeList(
130 "convergence_criterion");
131 std::transform(coupling_convergence_criterion_config.begin(),
132 coupling_convergence_criterion_config.end(),
133 std::back_inserter(global_coupling_conv_criteria),
134 [](BaseLib::ConfigTree const& c)
135 { return NumLib::createConvergenceCriterion(c); });
136
137 all_local_coupling_parameters = parseLocalCoupling(
138 *coupling_config, global_coupling_conv_criteria.size());
139 }
140
141 return {std::move(global_coupling_conv_criteria),
142 std::move(all_local_coupling_parameters), max_coupling_iterations};
143}
std::vector< LocalCouplingParameters > parseLocalCoupling(BaseLib::ConfigTree const &config, const std::size_t max_process_number)

References BaseLib::ConfigTree::getConfigSubtreeOptional(), and parseLocalCoupling().

Referenced by createStaggeredCoupling().

◆ parseEvolutionaryPIDcontroller()

EvolutionaryPIDcontrollerParameters NumLib::parseEvolutionaryPIDcontroller ( BaseLib::ConfigTree const & config)

Parse 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 23 of file CreateEvolutionaryPIDcontroller.cpp.

25{
27 config.checkConfigParameter("type", "EvolutionaryPIDcontroller");
28
30 auto const t0 = config.getConfigParameter<double>("t_initial");
32 auto const t_end = config.getConfigParameter<double>("t_end");
33
35 auto const h0 = config.getConfigParameter<double>("dt_guess");
36
38 auto const h_min = config.getConfigParameter<double>("dt_min");
40 auto const h_max = config.getConfigParameter<double>("dt_max");
42 auto const rel_h_min = config.getConfigParameter<double>("rel_dt_min");
44 auto const rel_h_max = config.getConfigParameter<double>("rel_dt_max");
45
47 auto const tol = config.getConfigParameter<double>("tol");
48
49 return {t0, t_end, h0, h_min, h_max, rel_h_min, rel_h_max, tol};
50}

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

Referenced by createTimeStepper().

◆ parseFixedTimeStepping()

FixedTimeSteppingParameters NumLib::parseFixedTimeStepping ( 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__n_steps
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 21 of file CreateFixedTimeStepping.cpp.

23{
25 config.checkConfigParameter("type", "FixedTimeStepping");
26
28 auto const t_initial = config.getConfigParameter<double>("t_initial");
30 auto const t_end = config.getConfigParameter<double>("t_end");
31
33 auto const n_steps = config.getConfigParameterOptional<int>("n_steps");
34 if (n_steps.has_value())
35 {
36 if (t_end <= t_initial)
37 {
39 "Creating linearly spaced time steps vector using "
40 "FixedTimeStepping algorithm failed! "
41 "User provided start value (t_initial) "
42 "{} is not smaller then end value (t_end) {}.",
43 t_initial, t_end);
44 }
45
46 if (*n_steps <= 0)
47 {
49 "Requested number of time steps in time steps vector "
50 "(n_steps) must be greater then 0. "
51 "{} time steps were requested",
52 *n_steps);
53 }
54 // Create the RepeatDtPair
55 double const t_step =
56 (t_end - t_initial) / static_cast<double>(*n_steps);
57 std::vector const repeat_pairs = {
58 RepeatDtPair{static_cast<std::size_t>(*n_steps), t_step}};
59 return {t_initial, t_end, repeat_pairs};
60 }
61
63 auto const delta_ts_config = config.getConfigSubtree("timesteps");
64
65 // TODO: consider adding call "listNonEmpty" to config tree
67 auto const range = delta_ts_config.getConfigSubtreeList("pair");
68 if (range.begin() == range.end())
69 {
70 OGS_FATAL("no timesteps have been given");
71 }
72
73 std::vector<RepeatDtPair> repeat_dt_pairs;
74 for (auto const pair : range)
75 {
76 repeat_dt_pairs.emplace_back(
78 pair.getConfigParameter<std::size_t>("repeat"),
80 pair.getConfigParameter<double>("delta_t"));
81 }
82
83 return {t_initial, t_end, repeat_dt_pairs};
84}
std::tuple< std::size_t, double > RepeatDtPair

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

Referenced by createTimeStepper().

◆ parseIterationNumberBasedTimeStepping()

IterationNumberBasedTimeSteppingParameters NumLib::parseIterationNumberBasedTimeStepping ( 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__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 23 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");
32 if (t_end < t_initial)
33 {
35 "iteration number based timestepping: t_end({}) is smaller than "
36 "t_initial({})",
37 t_end,
38 t_initial);
39 }
40
42 auto const initial_dt = config.getConfigParameter<double>("initial_dt");
44 auto const minimum_dt = config.getConfigParameter<double>("minimum_dt");
46 auto const maximum_dt = config.getConfigParameter<double>("maximum_dt");
47
48 auto number_iterations =
50 config.getConfigParameter<std::vector<int>>("number_iterations");
51 auto multiplier =
53 config.getConfigParameter<std::vector<double>>("multiplier");
54
55 return {t_initial,
56 t_end,
57 minimum_dt,
58 maximum_dt,
59 initial_dt,
60 std::move(number_iterations),
61 std::move(multiplier)};
62}

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

Referenced by createTimeStepper().

◆ parseLocalCoupling()

std::vector< LocalCouplingParameters > NumLib::parseLocalCoupling ( BaseLib::ConfigTree const & config,
const std::size_t max_process_number )

The function returns a set of process names and the maximum iteration number of a sub-coupling or nothing.

Input File Parameter
prj__time_loop__global_process_coupling__local_coupling_processes
Input File Parameter
prj__time_loop__global_process_coupling__local_coupling_processes__process_name
Input File Parameter
prj__time_loop__global_process_coupling__local_coupling_processes__max_iter

Definition at line 24 of file CreateStaggeredCoupling.cpp.

26{
27 auto const local_coupling_configs =
29 config.getConfigSubtreeList("local_coupling_processes");
30
31 if (local_coupling_configs.empty())
32 {
33 return {};
34 }
35
36 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
37 std::vector<std::string> all_local_process_names;
38 for (auto const& local_coupling_config : local_coupling_configs)
39 {
40 std::vector<std::string> process_names;
41
42 for (
43 auto name :
44 local_coupling_config
46 .getConfigParameterList<std::string>("process_name"))
47 {
48 if (std::find(process_names.begin(), process_names.end(), name) !=
49 process_names.end())
50 {
52 "The name of locally coupled process, {}, is not unique.",
53 name);
54 }
55 process_names.push_back(name);
56
57 all_local_process_names.push_back(name);
58 }
59
60 if (process_names.size() > max_process_number)
61 {
63 "The number of the locally coupled processes is greater "
64 "than the number of total coupled processes. "
65 "Please check the number of elements in the tag "
66 "'time_loop/global_process_coupling/"
67 "local_coupling_processes' in the project file.");
68 }
69
70 INFO("There are {:d} locally coupled processes.", process_names.size());
71
72 int max_iterations =
73 local_coupling_config
75 .getConfigParameter<int>("max_iter");
76
77 all_local_coupling_parameters.push_back(
78 {process_names, max_iterations});
79 }
80
81 // std::adjacent_find only finds equal elements directly next to each other.
82 // Therefore, a copy of the vector is sorted first and then it is checked
83 // for duplicated element.
84 std::vector<std::string> copy_all_local_process_names =
85 all_local_process_names;
86 std::sort(copy_all_local_process_names.begin(),
87 copy_all_local_process_names.end());
88 if (auto it = std::adjacent_find(copy_all_local_process_names.begin(),
89 copy_all_local_process_names.end());
90 it != copy_all_local_process_names.end())
91 {
93 "There are process names appearing in multiple tags of "
94 "'time_loop/global_process_coupling/local_coupling_processes'. For "
95 "example, name {}",
96 *it);
97 }
98
99 return all_local_coupling_parameters;
100}

References BaseLib::ConfigTree::getConfigSubtreeList(), INFO(), and OGS_FATAL.

Referenced by parseCoupling().

◆ possiblyClampDtToNextFixedTime()

double NumLib::possiblyClampDtToNextFixedTime ( Time 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 19 of file TimeStepAlgorithm.cpp.

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

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

◆ 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 80 of file Interpolation.h.

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

References NumLib::detail::shapeFunctionInterpolate().

◆ transformVariableFromGlobalVector() [1/2]

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 map_function )

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 61 of file DOFTableUtil.h.

65{
67
68 // We fill the output with zeroes, because filling with NaN
69 // "breaks" visualization, e.g. of heat or mass flow rate
70 // with Taylor-Hood elements. I.e., all lower order
71 // properties would have NaN on the higher order nodes.
72 std::fill(begin(output_vector), end(output_vector), 0);
73
74 int const n_components =
75 local_to_global_index_map.getNumberOfVariableComponents(variable_id);
76 for (int component = 0; component < n_components; ++component)
77 {
78 auto const& mesh_subset =
79 local_to_global_index_map.getMeshSubset(variable_id, component);
80 auto const mesh_id = mesh_subset.getMeshID();
81 for (auto const& node : mesh_subset.getNodes())
82 {
83 auto const node_id = node->getID();
85 node_id);
86 auto const input_index = local_to_global_index_map.getGlobalIndex(
87 l, variable_id, component);
88 double const value = input_vector[input_index];
89
90 output_vector.getComponent(node_id, component) =
91 map_function(value);
92 }
93 }
94}
std::vector< std::size_t > getNodes(GeoLib::Point const &pnt, std::vector< MeshLib::Node * > const &nodes, MeshLib::PropertyVector< int > const &mat_ids, std::pair< int, int > const &mat_limits, std::pair< double, double > const &elevation_limits, MeshLib::Mesh const &mesh)
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().

◆ transformVariableFromGlobalVector() [2/2]

template<typename Functor >
void NumLib::transformVariableFromGlobalVector ( GlobalVector const & input_vector_on_bulk_mesh,
int const variable_id,
NumLib::LocalToGlobalIndexMap const & local_to_global_index_map,
MeshLib::PropertyVector< double > & output_vector_on_submesh,
std::vector< std::size_t > const & map_submesh_node_id_to_bulk_mesh_node_id,
Functor map_function )

Overload that can be used to transform and project nodal data from the bulk mesh to submeshes, e.g., for the output if residuum vectors on submeshes.

Definition at line 99 of file DOFTableUtil.h.

105{
106 MathLib::LinAlg::setLocalAccessibleVector(input_vector_on_bulk_mesh);
107
108 // We fill the output with zeroes, because filling with NaN
109 // "breaks" visualization, e.g. of heat or mass flow rate
110 // with Taylor-Hood elements. I.e., all lower order
111 // properties would have NaN on the higher order nodes.
112 std::fill(begin(output_vector_on_submesh), end(output_vector_on_submesh),
113 0);
114
115 int const n_components =
116 local_to_global_index_map.getNumberOfVariableComponents(variable_id);
117 for (int component = 0; component < n_components; ++component)
118 {
119 auto const& mesh_subset =
120 local_to_global_index_map.getMeshSubset(variable_id, component);
121 auto const mesh_id = mesh_subset.getMeshID();
122
123 for (std::size_t submesh_node_id = 0;
124 submesh_node_id < map_submesh_node_id_to_bulk_mesh_node_id.size();
125 ++submesh_node_id)
126 {
127 std::size_t const bulk_node_id =
128 map_submesh_node_id_to_bulk_mesh_node_id[submesh_node_id];
130 bulk_node_id);
131 auto const input_index = local_to_global_index_map.getGlobalIndex(
132 l, variable_id, component);
133
134 // On higher-order meshes some d.o.f.s might not be defined on all
135 // nodes. We silently ignore the d.o.f.s we cannot find.
136 [[unlikely]] if (input_index == NumLib::MeshComponentMap::nop)
137 {
138 continue;
139 }
140
141 double const value = input_vector_on_bulk_mesh[input_index];
142
143 output_vector_on_submesh.getComponent(submesh_node_id, component) =
144 map_function(value);
145 }
146 }
147}

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

◆ updateTimeSteps()

void NumLib::updateTimeSteps ( double const dt,
TimeStep & previous_timestep,
TimeStep & current_timestep )
inline

Definition at line 100 of file TimeStep.h.

102{
103 previous_timestep = current_timestep;
104 current_timestep += dt;
105}

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