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...
enum class  MultiplyerInterpolationType { PiecewiseConstant , PiecewiseLinear }

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::Location const &location, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const global_component_id)
double getNodalValue (GlobalVector const &x, MeshLib::Location const &location, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const global_component_id)
std::vector< GlobalIndexTypegetIndices (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
std::vector< GlobalIndexTypegetIndices (std::size_t const variable_id, std::size_t const component_id, std::size_t const bulk_element_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)
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::span< std::size_t const > 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<int DisplacementDim, typename ShapeFunction, typename ShapeMatricesType, typename IpData>
Eigen::Vector3d averageGradShapeFunction (int const local_node_id, MeshLib::Element const &element, NumLib::GenericIntegrationMethod const &integration_method, std::vector< IpData, Eigen::aligned_allocator< IpData > > const &ip_data, const bool is_axially_symmetric)
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, int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL>
ShapeMatricesType::ShapeMatrices initShapeMatricesAtElementCenter (MeshLib::Element const &e, bool const is_axially_symmetric)
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 LinearSolver, typename JacobianMatrixUpdate, typename ResidualUpdate, typename SolutionUpdate>
NewtonRaphson< LinearSolver, JacobianMatrixUpdate, ResidualUpdate, SolutionUpdate > makeNewtonRaphson (LinearSolver &linear_solver, JacobianMatrixUpdate &&jacobian_update, ResidualUpdate &&residual_update, SolutionUpdate &&solution_update, NewtonRaphsonSolverParameters const &solver_parameters)
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 findMultiplier (int const number_iterations, bool const current_time_step_is_accepted, std::vector< int > const &nonlinear_iteration_numbers, std::vector< double > const &multipliers, MultiplyerInterpolationType const multiplier_interpolation_type)
 Find a multiplier for the given number of iterations.
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:95

Definition at line 93 of file ElementTraitsLagrange.h.

◆ CouplingNodeVariant

◆ MinimumPerturbation

◆ NumericalStabilization

◆ RelativeEpsilon

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

Definition at line 14 of file NumericalDifferentiation.h.

◆ RepeatDtPair

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

Definition at line 13 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 13 of file MeshComponentMap.h.

14{
17};
@ BY_LOCATION
Ordering data by spatial location.
@ BY_COMPONENT
Ordering data by component type.

◆ MultiplyerInterpolationType

◆ 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 14 of file ShapeMatrices.h.

15{
16 N,
17 DNDR,
18 N_J,
19 DNDR_J,
20 DNDX,
21 ALL
22};
@ 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 108 of file AdvectionMatrixAssembler.h.

114{
115 std::visit(
116 [&](auto&& stabilizer)
117 {
118 using Stabilizer = std::decay_t<decltype(stabilizer)>;
119 if constexpr (std::is_same_v<Stabilizer, FullUpwind>)
120 {
121 if (average_velocity > stabilizer.getCutoffVelocity())
122 {
123 detail::applyFullUpwind(ip_data_vector, ip_flux_vector,
124 laplacian_matrix);
125 return;
126 }
127 }
128
130 ip_data_vector, shape_matrix_cache, ip_flux_vector,
131 laplacian_matrix);
132 },
133 stabilizer);
134}
void assembleAdvectionMatrix(IPData const &ip_data_vector, NumLib::ShapeMatrixCache const &shape_matrix_cache, std::vector< FluxVectorType > const &ip_flux_vector, Eigen::MatrixBase< Derived > &laplacian_matrix)
void applyFullUpwind(Eigen::VectorXd const &quasi_nodal_flux, Eigen::MatrixBase< Derived > &laplacian_matrix)

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 137 of file AdvectionMatrixAssembler.h.

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

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

◆ averageGradShapeFunction()

template<int DisplacementDim, typename ShapeFunction, typename ShapeMatricesType, typename IpData>
Eigen::Vector3d NumLib::averageGradShapeFunction ( int const local_node_id,
MeshLib::Element const & element,
NumLib::GenericIntegrationMethod const & integration_method,
std::vector< IpData, Eigen::aligned_allocator< IpData > > const & ip_data,
const bool is_axially_symmetric )

The function computes the element average of \(\nabla N_i\) by

\[ \bar{\nabla N_i} = \frac{\int_{\Omega_e}\nabla N_i{\mathrm d}\Omega} {\int_{\Omega_e}{\mathrm d}\Omega}. \]

Parameters
local_node_idNode ID in an element,
elementElement,
integration_methodIntegration method,
ip_dataIntegration point data,
is_axially_symmetricIndicator for axisymmetry.
Returns
Averaged \(\nabla N_i\) of an element.

Definition at line 32 of file AverageGradShapeFunction.h.

38{
39 Eigen::Vector3d bar_gradN = Eigen::Vector3d::Zero();
40 unsigned const n_integration_points =
41 integration_method.getNumberOfPoints();
42 assert(n_integration_points == ip_data.size());
43 for (unsigned ip = 0; ip < n_integration_points; ip++)
44 {
45 auto const& N = ip_data[ip].N_u;
46 auto const& dNdx = ip_data[ip].dNdx_u;
47
48 auto const dNidx = dNdx.col(local_node_id);
49
50 auto const& w = ip_data[ip].integration_weight;
51 bar_gradN.template segment<DisplacementDim>(0) += dNidx * w;
52
53 if (is_axially_symmetric)
54 {
55 auto const x_coord =
57 ShapeMatricesType>(element, N);
58 bar_gradN[2] += w * N(local_node_id) / x_coord;
59 }
60 }
61 return bar_gradN;
62}
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)

References NumLib::GenericIntegrationMethod::getNumberOfPoints(), interpolateXCoordinate(), and N.

Referenced by ProcessLib::LinearBMatrix::computeDilatationalBbar(), and ProcessLib::NonLinearFbar::computeFBarInitialVariablesAverage().

◆ canReduceTimestepSize()

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

Definition at line 34 of file TimeStepAlgorithm.cpp.

37{
38 return !(timestep_current.dt() == min_dt &&
39 timestep_previous.dt() == min_dt);
40}

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 17 of file CreateStaggeredCoupling-impl.h.

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

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 41 of file ConvergenceCriterion.cpp.

43{
44 auto const eps = std::numeric_limits<double>::epsilon();
45 return std::abs(numerator) <
46 std::abs(reltol) * (std::abs(denominator) + eps);
47}

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

◆ cleanupGlobalMatrixProviders()

void NumLib::cleanupGlobalMatrixProviders ( )

Definition at line 22 of file GlobalMatrixProviders.cpp.

23{
25}
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 )

Definition at line 542 of file FluxCorrectedTransport.cpp.

548{
549 // if needed, calling the Flux-Corrected-Transport function
550 return std::visit(
551 [&](auto&& stabilizer)
552 {
553 using Stabilizer = std::decay_t<decltype(stabilizer)>;
554 if constexpr (std::is_same_v<Stabilizer,
556 {
558 t, dt, x, x_prev, process_id, matrix_specification, M, K,
559 b);
560 }
561 },
562 stabilizer);
563}
void calculateFluxCorrectedTransport(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)

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 65 of file HydrodynamicDispersion.h.

73{
74 return std::visit(
75 [&](auto&& stabilizer)
76 {
77 using Stabilizer = std::decay_t<decltype(stabilizer)>;
78 if constexpr (std::is_same_v<Stabilizer,
80 {
82 stabilizer,
83 element_id,
84 pore_diffusion_coefficient,
85 velocity,
86 porosity,
87 solute_dispersivity_transverse,
88 solute_dispersivity_longitudinal);
89 }
90
92 pore_diffusion_coefficient,
93 velocity,
94 porosity,
95 solute_dispersivity_transverse,
96 solute_dispersivity_longitudinal);
97 },
98 stabilizer);
99}
Eigen::MatrixXd getHydrodynamicDispersion(Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
Eigen::MatrixXd getHydrodynamicDispersionWithArtificialDiffusion(IsotropicDiffusionStabilization 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)

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

22{
23 std::vector<
24 typename ShapeMatricesType::ShapeMatrices,
25 Eigen::aligned_allocator<typename ShapeMatricesType::ShapeMatrices>>
26 shape_matrices;
27
28 auto const fe =
30
31 shape_matrices.reserve(points.size());
32 for (auto const& p : points)
33 {
34 shape_matrices.emplace_back(ShapeFunction::DIM, GlobalDim,
35 ShapeFunction::NPOINTS);
36 fe.template computeShapeFunctions<SelectedShapeMatrixType>(
37 p.data(), shape_matrices.back(), GlobalDim, is_axially_symmetric);
38 }
39
40 return shape_matrices;
41}
NumLib::TemplateIsoparametric< ShapeFunction, ShapeMatricesType > createIsoparametricFiniteElement(MeshLib::Element const &e)

References createIsoparametricFiniteElement().

Referenced by ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, LowerOrderShapeFunction, GlobalDim >::computeLowerOrderShapeMatrix(), NumLib::TemplateIsoparametric< ShapePoint1, T_SHAPE_MATRIX_POLICY< ShapePoint1 > >::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(), initShapeMatricesAtElementCenter(), 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 69 of file ComputeSparsityPattern.cpp.

71{
72#ifdef USE_PETSC
73 return computeSparsityPatternPETSc(dof_table, mesh);
74#else
75 return computeSparsityPatternNonPETSc(dof_table, mesh);
76#endif
77}
GlobalSparsityPattern computeSparsityPatternPETSc(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)

References computeSparsityPatternPETSc().

Referenced by ProcessLib::Process::computeSparsityPattern(), ProcessLib::HMPhaseField::HMPhaseFieldProcess< DisplacementDim >::constructDofTable(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::constructDofTable(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::constructDofTable(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< 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 15 of file ConvergenceCriterion.cpp.

17{
19 auto const type = config.peekConfigParameter<std::string>("type");
20
21 if (type == "DeltaX")
22 {
24 }
25 if (type == "Residual")
26 {
28 }
29 if (type == "PerComponentDeltaX")
30 {
32 }
33 if (type == "PerComponentResidual")
34 {
36 }
37
38 OGS_FATAL("There is no convergence criterion of type `{:s}'.", type);
39}
T peekConfigParameter(std::string const &param) const
std::unique_ptr< ConvergenceCriterionResidual > createConvergenceCriterionResidual(const BaseLib::ConfigTree &config)
std::unique_ptr< ConvergenceCriterionPerComponentDeltaX > createConvergenceCriterionPerComponentDeltaX(const BaseLib::ConfigTree &config)
std::unique_ptr< ConvergenceCriterionDeltaX > createConvergenceCriterionDeltaX(const BaseLib::ConfigTree &config)
std::unique_ptr< ConvergenceCriterionPerComponentResidual > createConvergenceCriterionPerComponentResidual(const BaseLib::ConfigTree &config)

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

Referenced by ProcessLib::createPerProcessData().

◆ 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 54 of file ConvergenceCriterionDeltaX.cpp.

56{
58 config.checkConfigParameter("type", "DeltaX");
59
61 auto abstol = config.getConfigParameterOptional<double>("abstol");
63 auto reltol = config.getConfigParameterOptional<double>("reltol");
64 auto const norm_type_str =
66 config.getConfigParameter<std::string>("norm_type");
67 auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
68
69 if (norm_type == MathLib::VecNormType::INVALID)
70 {
71 OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
72 }
73
74 return std::make_unique<ConvergenceCriterionDeltaX>(
75 std::move(abstol), std::move(reltol), norm_type);
76}
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__damping_alpha
Input File Parameter
prj__time_loop__processes__process__convergence_criterion__PerComponentDeltaX__norm_type

Definition at line 126 of file ConvergenceCriterionPerComponentDeltaX.cpp.

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

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__damping_alpha
Input File Parameter
prj__time_loop__processes__process__convergence_criterion__PerComponentResidual__norm_type

Definition at line 162 of file ConvergenceCriterionPerComponentResidual.cpp.

164{
166 config.checkConfigParameter("type", "PerComponentResidual");
167
168 auto abstols =
170 config.getConfigParameterOptional<std::vector<double>>("abstols");
171 auto reltols =
173 config.getConfigParameterOptional<std::vector<double>>("reltols");
174 auto damping_alpha =
176 config.getConfigParameterOptional<std::vector<double>>("damping_alpha");
177 auto const norm_type_str =
179 config.getConfigParameter<std::string>("norm_type");
180
181 bool damping_alpha_switch = true;
182 if ((!abstols) && (!reltols))
183 {
184 OGS_FATAL(
185 "At least one of absolute or relative tolerance has to be "
186 "specified.");
187 }
188 if (!abstols)
189 {
190 abstols = std::vector<double>(reltols->size());
191 }
192 else if (!reltols)
193 {
194 reltols = std::vector<double>(abstols->size());
195 }
196 if (!damping_alpha)
197 {
198 damping_alpha = std::vector<double>(abstols->size(), 0.0);
199 damping_alpha_switch = false;
200 }
201
202 auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
203
204 if (norm_type == MathLib::VecNormType::INVALID)
205 {
206 OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
207 }
208
209 return std::make_unique<ConvergenceCriterionPerComponentResidual>(
210 std::move(*abstols), std::move(*reltols), std::move(*damping_alpha),
211 damping_alpha_switch, norm_type);
212}

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 88 of file ConvergenceCriterionResidual.cpp.

89{
91 config.checkConfigParameter("type", "Residual");
92
94 auto abstol = config.getConfigParameterOptional<double>("abstol");
96 auto reltol = config.getConfigParameterOptional<double>("reltol");
97 auto const norm_type_str =
99 config.getConfigParameter<std::string>("norm_type");
100 auto const norm_type = MathLib::convertStringToVecNormType(norm_type_str);
101
102 if (norm_type == MathLib::VecNormType::INVALID)
103 {
104 OGS_FATAL("Unknown vector norm type `{:s}'.", norm_type_str);
105 }
106
107 return std::make_unique<ConvergenceCriterionResidual>(
108 std::move(abstol), std::move(reltol), norm_type);
109}

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 137 of file CreateStaggeredCoupling-impl.h.

143{
144 checkLocalCouplingParameters(per_process_data,
145 all_local_coupling_parameters);
146
147 // First, get the coupling nodes that do not have local-coupling nodes.
148 std::vector<CouplingNodeVariant> coupling_nodes =
150 per_process_data, all_local_coupling_parameters,
151 global_max_coupling_iterations, global_coupling_conv_criteria);
152
153 // Second, get the coupling nodes that have local-coupling nodes.
154 std::vector<CouplingNodeVariant> root_coupling_nodes =
155 createRootCouplingNodes(per_process_data, all_local_coupling_parameters,
156 global_max_coupling_iterations,
157 global_coupling_conv_criteria);
158
159 std::size_t const num_coupling_nodes =
160 coupling_nodes.size() +
161 std::accumulate(
162 root_coupling_nodes.begin(),
163 root_coupling_nodes.end(),
164 std::size_t{0},
165 [](std::size_t accumulated_sizes, const auto& coupling_node)
166 {
167 return accumulated_sizes +
168 std::get<RootCouplingNode>(coupling_node)
169 .sub_coupling_nodes.size();
170 });
171
172 if (num_coupling_nodes != per_process_data.size())
173 {
174 OGS_FATAL(
175 "The number of all coupling nodes including sub-nodes is not "
176 "identical to the number of the processes! Please check the "
177 "element by tag global_process_coupling in the project file.");
178 }
179
180 if (coupling_nodes.empty())
181 {
182 coupling_nodes = std::move(root_coupling_nodes);
183 }
184 else
185 {
186 coupling_nodes.reserve(coupling_nodes.size() +
187 root_coupling_nodes.size());
188
189 std::move(std::begin(root_coupling_nodes),
190 std::end(root_coupling_nodes),
191 std::back_inserter(coupling_nodes));
192 }
193
194 return coupling_nodes;
195}
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 44 of file CreateEvolutionaryPIDcontroller.cpp.

47{
48 if (config.t_end < config.t0)
49 {
51 "Evolutionary PID controller timestepping: end time ({}) is "
52 "smaller than initial time ({})",
53 config.t_end,
54 config.t0);
55 }
56
57 return std::make_unique<EvolutionaryPIDcontroller>(config.t0,
58 config.t_end,
59 config.h0,
60 config.h_min,
61 config.h_max,
62 config.rel_h_min,
63 config.rel_h_max,
64 config.tol,
65 fixed_times_for_output);
66}

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 78 of file CreateFixedTimeStepping.cpp.

81{
82 if (parameters.t_end < parameters.t_initial)
83 {
85 "fixed timestepping: end time ({}) is smaller than initial time "
86 "({})",
87 parameters.t_end,
88 parameters.t_initial);
89 }
90
91 if (!FixedTimeStepping::areRepeatDtPairsValid(parameters.repeat_dt_pairs))
92 {
94 "CreateFixedTimeStepping: invalid specification of (repeat, "
95 "delta_t) pairs");
96 }
97
98 return std::make_unique<FixedTimeStepping>(parameters.t_initial,
99 parameters.t_end,
100 parameters.repeat_dt_pairs,
101 fixed_times_for_output);
102}
static bool areRepeatDtPairsValid(std::vector< RepeatDtPair > const &repeat_dt_pairs)

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 70 of file CreateIterationNumberBasedTimeStepping.cpp.

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

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 11 of file CreateNewtonRaphsonSolverParameters.cpp.

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

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
Input File Parameter
prj__processes__process__numerical_stabilization__FluxCorrectedTransport

Definition at line 14 of file CreateNumericalStabilization.cpp.

16{
17 auto const stabilization_config =
19 config.getConfigSubtreeOptional("numerical_stabilization");
20 if (!stabilization_config)
21 {
22 return NoStabilization{};
23 }
24
25 auto const type =
27 stabilization_config->getConfigParameter<std::string>("type");
28
29 INFO("Using {:s} numerical stabilization.", type);
30 if (type == "IsotropicDiffusion")
31 {
32 auto const cutoff_velocity =
34 stabilization_config->getConfigParameter<double>("cutoff_velocity");
35
36 auto const tuning_parameter =
38 stabilization_config->getConfigParameter<double>(
39 "tuning_parameter");
40
42 cutoff_velocity, tuning_parameter,
43 MeshLib::getMaxiumElementEdgeLengths(mesh.getElements())};
44 }
45 if (type == "FullUpwind")
46 {
47 auto const cutoff_velocity =
49 stabilization_config->getConfigParameter<double>("cutoff_velocity");
50
51 return FullUpwind{cutoff_velocity};
52 }
53 if (type == "FluxCorrectedTransport")
54 {
57 }
58
59 OGS_FATAL("The stabilization type {:s} is not available.", type);
60}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28
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 48 of file CreateStaggeredCoupling-impl.h.

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

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 93 of file CreateStaggeredCoupling-impl.h.

99{
100 std::vector<CouplingNodeVariant> coupling_nodes;
101
102 for (auto const& local_coupling_parameters : all_local_coupling_parameters)
103 {
104 RootCouplingNode root_node = {global_max_coupling_iterations, {}};
105
106 for (auto const& local_process_name :
107 local_coupling_parameters.process_names)
108 {
109 if (auto it = std::find_if(
110 per_process_data.begin(),
111 per_process_data.end(),
112 [&local_process_name](auto const& process_data) {
113 return process_data->process_name == local_process_name;
114 });
115 it != per_process_data.end())
116 {
117 auto const& process_data = *it;
118
119 CouplingNode regular_node{
120 process_data->process_name,
121 std::move(global_coupling_conv_criteria[process_data
122 ->process_id]),
123 local_coupling_parameters.max_iterations,
124 process_data->process_id};
125
126 root_node.sub_coupling_nodes.emplace_back(
127 std::move(regular_node));
128 }
129 }
130 coupling_nodes.emplace_back(std::move(root_node));
131 }
132
133 return coupling_nodes;
134}
Information of a coupling node.
std::vector< CouplingNodeVariant > sub_coupling_nodes

References 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 199 of file CreateStaggeredCoupling-impl.h.

202{
203 auto [global_coupling_conv_criteria, all_local_coupling_parameters,
204 max_coupling_iterations] = parseCoupling(config);
205
206 if (per_process_data.size() != global_coupling_conv_criteria.size())
207 {
208 OGS_FATAL(
209 "The number of convergence criteria of the global "
210 "staggered coupling loop is not identical to the number of the "
211 "processes! Please check the element by tag "
212 "global_process_coupling in the project file.");
213 }
214
215 auto coupling_nodes = createCouplingNodes(
216 per_process_data, all_local_coupling_parameters,
217 max_coupling_iterations, global_coupling_conv_criteria);
218
219 return std::make_unique<StaggeredCoupling>(max_coupling_iterations,
220 std::move(coupling_nodes));
221}
std::vector< CouplingNodeVariant > 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)
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 12 of file TimeDiscretizationBuilder.cpp.

14{
16 auto const type = config.getConfigParameter<std::string>("type");
17
19 if (type == "BackwardEuler")
20 {
21 return std::make_unique<BackwardEuler>();
22 }
23 OGS_FATAL("Unrecognized time discretization type `{:s}'", type);
24}

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 18 of file CreateTimeStepper.cpp.

21{
23 auto const type = config.peekConfigParameter<std::string>("type");
24
25 if (type == "SingleStep")
26 {
28 config.ignoreConfigParameter("type");
29 return std::make_unique<NumLib::FixedTimeStepping>(0.0, 1.0, 1.0);
30 }
31 if (type == "FixedTimeStepping")
32 {
34 fixed_times_for_output);
35 }
36 if (type == "EvolutionaryPIDcontroller")
37 {
39 parseEvolutionaryPIDcontroller(config), fixed_times_for_output);
40 }
41 if (type == "IterationNumberBasedTimeStepping")
42 {
45 fixed_times_for_output);
46 }
48 "Unknown time stepping type: '{:s}'. The available types are: "
49 "\n\tSingleStep,"
50 "\n\tFixedTimeStepping,"
51 "\n\tEvolutionaryPIDcontroller,",
52 "\n\tIterationNumberBasedTimeStepping\n",
53 type.data());
54}
std::unique_ptr< TimeStepAlgorithm > createEvolutionaryPIDcontroller(EvolutionaryPIDcontrollerParameters const &config, std::vector< double > const &fixed_times_for_output)
EvolutionaryPIDcontrollerParameters parseEvolutionaryPIDcontroller(BaseLib::ConfigTree const &config)
FixedTimeSteppingParameters parseFixedTimeStepping(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 47 of file FixedTimeStepping.cpp.

50{
51 if (fixed_output_time < t_initial)
52 {
53 return std::numeric_limits<std::size_t>::max();
54 }
55
56 auto timestepper_time = t_initial;
57 for (std::size_t k = 0; k < delta_ts.size(); ++k)
58 {
59 if (timestepper_time <= fixed_output_time &&
60 fixed_output_time < timestepper_time + delta_ts[k])
61 {
62 return k;
63 }
64 timestepper_time += delta_ts[k];
65 }
66
67 return std::numeric_limits<std::size_t>::max();
68}

Referenced by incorporateFixedTimesForOutput().

◆ findMultiplier()

double NumLib::findMultiplier ( int const number_iterations,
bool const current_time_step_is_accepted,
std::vector< int > const & nonlinear_iteration_numbers,
std::vector< double > const & multipliers,
MultiplyerInterpolationType const multiplier_interpolation_type )

Find a multiplier for the given number of iterations.

Definition at line 94 of file IterationNumberBasedTimeStepping.cpp.

99{
100 double multiplier = multipliers.front();
101 switch (multiplier_interpolation_type)
102 {
104 {
105 auto const& pwli = MathLib::PiecewiseLinearInterpolation(
106 nonlinear_iteration_numbers, multipliers, false);
107 multiplier = pwli.getValue(number_iterations);
108 break;
109 }
111 auto const& piecewise_constant_interpolation =
113 nonlinear_iteration_numbers, multipliers);
114 multiplier =
115 piecewise_constant_interpolation.value(number_iterations);
116 break;
117 }
118
119 if (!current_time_step_is_accepted && (multiplier >= 1.0))
120 {
121 return *std::min_element(multipliers.begin(), multipliers.end());
122 }
123
124 return multiplier;
125}

References PiecewiseConstant, and PiecewiseLinear.

Referenced by NumLib::IterationNumberBasedTimeStepping::getNextTimeStepSize().

◆ 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 314 of file MeshComponentMap.cpp.

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

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

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

◆ getIndices() [1/2]

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

108{
109 assert(dof_table.size() > mesh_item_id);
110 std::vector<GlobalIndexType> indices;
111
112 // Local matrices and vectors will always be ordered by component
113 // no matter what the order of the global matrix is.
114 for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c)
115 {
116 auto const& idcs = dof_table(mesh_item_id, c).rows;
117 indices.reserve(indices.size() + idcs.size());
118 indices.insert(indices.end(), idcs.begin(), idcs.end());
119 }
120
121 return indices;
122}

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(), anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::assembleForStaggeredSchemeOneElement(), anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::assembleOneElement(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::assembleReactionEquation(), ProcessLib::VectorMatrixAssembler::assembleWithJacobian(), anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::assembleWithJacobianForStaggeredSchemeOneElement(), anonymous_namespace{ParallelVectorMatrixAssembler.cpp}::assembleWithJacobianOneElement(), 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::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtHeatFlux(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtLiquidDensity(), 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().

◆ getIndices() [2/2]

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

Returns nodal indices for the item identified by component_item_id and variable_id and bulk_element_id from thegiven dof_table.

Definition at line 124 of file DOFTableUtil.cpp.

129{
130 auto const& ms =
131 dof_table.getMeshSubset(variable_id, component_id).getMesh();
132 std::vector<GlobalIndexType> indices;
133 auto const& bulk_element = ms.getElement(bulk_element_id);
134 auto const global_component =
135 dof_table.getGlobalComponent(variable_id, component_id);
136 auto const mesh_id = ms.getID();
137
138 for (auto const node_id : bulk_element->nodes() | MeshLib::views::ids)
139 {
141 node_id};
142 // TODO: possible issues on higher order meshes with first order
143 // variables (e.g. pressure in HM).
144 indices.push_back(dof_table.getGlobalIndex(loc, global_component));
145 }
146 return indices;
147}
constexpr ranges::views::view_closure ids
For an element of a range view return its id.
Definition Mesh.h:216

References MeshLib::Mesh::getElement(), NumLib::LocalToGlobalIndexMap::getGlobalComponent(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), MeshLib::MeshSubset::getMesh(), NumLib::LocalToGlobalIndexMap::getMeshSubset(), MeshLib::views::ids, and MeshLib::Node.

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

190{
191 Eigen::VectorXd local_x_vec;
192
193 auto const n_processes = x.size();
194 for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
195 {
196 auto const indices =
197 NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
198 assert(!indices.empty());
199 auto const last = local_x_vec.size();
200 local_x_vec.conservativeResize(last + indices.size());
201 auto const local_solution = x[process_id]->get(indices);
202 assert(indices.size() == local_solution.size());
203 local_x_vec.tail(local_solution.size()).noalias() =
204 MathLib::toVector(local_solution);
205 }
206 return local_x_vec;
207}
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::Location const & location,
NumLib::LocalToGlobalIndexMap const & dof_table,
std::size_t const global_component_id )

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

Definition at line 95 of file DOFTableUtil.cpp.

98{
99 auto const index = dof_table.getGlobalIndex(location, global_component_id);
100 assert(index != NumLib::MeshComponentMap::nop);
101
102 return x.get(index);
103}
static constexpr NUMLIB_EXPORT GlobalIndexType const nop

References MathLib::EigenVector::get(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), and NumLib::MeshComponentMap::nop.

◆ getNonGhostNodalValue()

double NumLib::getNonGhostNodalValue ( GlobalVector const & x,
MeshLib::Location const & location,
NumLib::LocalToGlobalIndexMap const & dof_table,
std::size_t const global_component_id )

Returns the value for the given location 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 79 of file DOFTableUtil.cpp.

83{
84 auto const index = dof_table.getGlobalIndex(location, global_component_id);
85 assert(index != NumLib::MeshComponentMap::nop);
86
87 if (index < 0)
88 { // ghost node value
89 return 0.0;
90 }
91
92 return x.get(index);
93}

References MathLib::EigenVector::get(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), 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 149 of file DOFTableUtil.cpp.

153{
154 assert(dof_table.size() > id);
155 indices.clear();
156
157 // Local matrices and vectors will always be ordered by component,
158 // no matter what the order of the global matrix is.
159 for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c)
160 {
161 auto const& idcs = dof_table(id, c).rows;
162 indices.reserve(indices.size() + idcs.size());
163 indices.insert(indices.end(), idcs.begin(), idcs.end());
164 }
165
167}
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(), and ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::getFlux().

◆ 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 70 of file FixedTimeStepping.cpp.

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

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

References computeShapeMatrices().

Referenced by ProcessLib::ConstraintDirichletBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::ConstraintDirichletBoundaryConditionLocalAssembler(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >::HeatTransportBHELocalAssemblerBHE(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::HeatTransportBHELocalAssemblerSoil(), ProcessLib::HMPhaseField::HMPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::HMPhaseFieldLocalAssembler(), ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >::HTFEM(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::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::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::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::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().

◆ initShapeMatricesAtElementCenter()

template<typename ShapeFunction, typename ShapeMatricesType, int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL>
ShapeMatricesType::ShapeMatrices NumLib::initShapeMatricesAtElementCenter ( MeshLib::Element const & e,
bool const is_axially_symmetric )

Definition at line 68 of file InitShapeMatrices.h.

70{
71 static constexpr std::array integration_points = {
72 MathLib::WeightedPoint{ShapeFunction::reference_element_centre, 1.0}};
73
74 auto const shape_matrices =
75 computeShapeMatrices<ShapeFunction, ShapeMatricesType, GlobalDim,
76 SelectedShapeMatrixType>(e, is_axially_symmetric,
77 integration_points);
78 return shape_matrices[0];
79}

References computeShapeMatrices().

Referenced by ProcessLib::NonLinearFbar::computeFBarInitialVariablesElementCenter().

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

96{
97 auto const fe =
99
100 return fe.interpolateCoordinates(N);
101}

References createIsoparametricFiniteElement(), and N.

Referenced by ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::HydroMechanicsLocalAssemblerFracture(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, DisplacementDim >::SmallDeformationLocalAssemblerFracture(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >::assemble(), ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >::assemble(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::WellboreSimulator::WellboreSimulatorFEM< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleBlockMatrices(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleBlockMatricesWithJacobian(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleBlockMatricesWithJacobian(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHeatTransportEquation(), ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >::assembleHydraulicEquation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleKCmCn(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleMatrixAndVector(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assembleWithJacobian(), 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::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::assembleWithJacobian(), ProcessLib::HMPhaseField::HMPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForHeatConductionEquations(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForPressureEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianPhaseFieldEquations(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >::computeEnergy(), ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >::computeProjectedDarcyVelocity(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::computeSecondaryVariableConcrete(), 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::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtHeatFlux(), ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::getIntPtSaturation(), ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >::initializeChemicalSystemConcrete(), 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::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postNonLinearSolverConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), 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, DisplacementDim >::postTimestepConcreteWithBlockVectors(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcreteWithVector(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, 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 100 of file Interpolation.h.

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

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::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, DisplacementDim >::postTimestepConcreteWithBlockVectors().

◆ interpolateXCoordinate()

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

◆ 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 56 of file LocalDOF.h.

57{
58 using namespace boost::mp11;
59
60 static_assert(sizeof...(Ns_t) > 0);
61
62 using Sizes = mp_list_c<int, detail::NumberOfDofs<Ns_t>::value...>;
63 using Offsets =
64 mp_push_front<mp_pop_back<mp_partial_sum<Sizes, mp_int<0>, mp_plus>>,
65 mp_int<0>>;
66
67 assert((mp_back<Offsets>::value + mp_back<Sizes>::value == x.size()) &&
68 "The passed shape matrices require a different number of "
69 "d.o.f.s than present in the passed element d.o.f. vector.");
70
71 return detail::localDOFImpl<Ns_t...>(x, Offsets{}, Sizes{});
72}
auto localDOFImpl(ElementDOFVector const &x, boost::mp11::mp_list_c< int, Offsets... >, boost::mp11::mp_list_c< int, Sizes... >)
Definition LocalDOF.h:34

References NumLib::detail::localDOFImpl().

Referenced by ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::localDOF(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, 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 142 of file ExtrapolatableElementCollection.h.

Referenced by ProcessLib::makeExtrapolator().

◆ makeNewtonRaphson()

template<typename LinearSolver, typename JacobianMatrixUpdate, typename ResidualUpdate, typename SolutionUpdate>
NewtonRaphson< LinearSolver, JacobianMatrixUpdate, ResidualUpdate, SolutionUpdate > NumLib::makeNewtonRaphson ( LinearSolver & linear_solver,
JacobianMatrixUpdate && jacobian_update,
ResidualUpdate && residual_update,
SolutionUpdate && solution_update,
NewtonRaphsonSolverParameters const & solver_parameters )

Definition at line 143 of file NewtonRaphson.h.

148{
149 return NewtonRaphson<LinearSolver, JacobianMatrixUpdate, ResidualUpdate,
150 SolutionUpdate>(
151 linear_solver, std::forward<JacobianMatrixUpdate>(jacobian_update),
152 std::forward<ResidualUpdate>(residual_update),
153 std::forward<SolutionUpdate>(solution_update), solver_parameters);
154}

Referenced by ApplicationUtils::ComputeNaturalCoordsSolverImplementation< ShapeFunction >::solve().

◆ norm()

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

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

172{
173 switch (norm_type)
174 {
176 return norm1(x, global_component, dof_table);
178 return norm2(x, global_component, dof_table);
180 return normInfinity(x, global_component, dof_table);
181 default:
182 OGS_FATAL("An invalid norm type has been passed.");
183 }
184}

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 120 of file ShapeMatrices-impl.h.

122{
123 shape.write(os);
124 return os;
125}
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 434 of file LocalToGlobalIndexMap.cpp.

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

◆ 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 97 of file CreateStaggeredCoupling.cpp.

98{
99 auto const& coupling_config
101 = config.getConfigSubtreeOptional("global_process_coupling");
102
103 std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>
104 global_coupling_conv_criteria;
105
106 std::vector<LocalCouplingParameters> all_local_coupling_parameters;
107
108 int max_coupling_iterations = 1;
109 if (coupling_config)
110 {
111 max_coupling_iterations
113 = coupling_config->getConfigParameter<int>("max_iter");
114
115 auto const& coupling_convergence_criteria_config =
117 coupling_config->getConfigSubtree("convergence_criteria");
118
119 auto coupling_convergence_criterion_config =
121 coupling_convergence_criteria_config.getConfigSubtreeList(
122 "convergence_criterion");
123 std::transform(coupling_convergence_criterion_config.begin(),
124 coupling_convergence_criterion_config.end(),
125 std::back_inserter(global_coupling_conv_criteria),
126 [](BaseLib::ConfigTree const& c)
127 { return NumLib::createConvergenceCriterion(c); });
128
129 all_local_coupling_parameters = parseLocalCoupling(
130 *coupling_config, global_coupling_conv_criteria.size());
131 }
132
133 return {std::move(global_coupling_conv_criteria),
134 std::move(all_local_coupling_parameters), max_coupling_iterations};
135}
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 15 of file CreateEvolutionaryPIDcontroller.cpp.

17{
19 config.checkConfigParameter("type", "EvolutionaryPIDcontroller");
20
22 auto const t0 = config.getConfigParameter<double>("t_initial");
24 auto const t_end = config.getConfigParameter<double>("t_end");
25
27 auto const h0 = config.getConfigParameter<double>("dt_guess");
28
30 auto const h_min = config.getConfigParameter<double>("dt_min");
32 auto const h_max = config.getConfigParameter<double>("dt_max");
34 auto const rel_h_min = config.getConfigParameter<double>("rel_dt_min");
36 auto const rel_h_max = config.getConfigParameter<double>("rel_dt_max");
37
39 auto const tol = config.getConfigParameter<double>("tol");
40
41 return {t0, t_end, h0, h_min, h_max, rel_h_min, rel_h_max, tol};
42}

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 13 of file CreateFixedTimeStepping.cpp.

15{
17 config.checkConfigParameter("type", "FixedTimeStepping");
18
20 auto const t_initial = config.getConfigParameter<double>("t_initial");
22 auto const t_end = config.getConfigParameter<double>("t_end");
23
25 auto const n_steps = config.getConfigParameterOptional<int>("n_steps");
26 if (n_steps.has_value())
27 {
28 if (t_end <= t_initial)
29 {
31 "Creating linearly spaced time steps vector using "
32 "FixedTimeStepping algorithm failed! "
33 "User provided start value (t_initial) "
34 "{} is not smaller then end value (t_end) {}.",
35 t_initial, t_end);
36 }
37
38 if (*n_steps <= 0)
39 {
41 "Requested number of time steps in time steps vector "
42 "(n_steps) must be greater then 0. "
43 "{} time steps were requested",
44 *n_steps);
45 }
46 // Create the RepeatDtPair
47 double const t_step =
48 (t_end - t_initial) / static_cast<double>(*n_steps);
49 std::vector const repeat_pairs = {
50 RepeatDtPair{static_cast<std::size_t>(*n_steps), t_step}};
51 return {t_initial, t_end, repeat_pairs};
52 }
53
55 auto const delta_ts_config = config.getConfigSubtree("timesteps");
56
57 // TODO: consider adding call "listNonEmpty" to config tree
59 auto const range = delta_ts_config.getConfigSubtreeList("pair");
60 if (range.begin() == range.end())
61 {
62 OGS_FATAL("no timesteps have been given");
63 }
64
65 std::vector<RepeatDtPair> repeat_dt_pairs;
66 for (auto const pair : range)
67 {
68 repeat_dt_pairs.emplace_back(
70 pair.getConfigParameter<std::size_t>("repeat"),
72 pair.getConfigParameter<double>("delta_t"));
73 }
74
75 return {t_initial, t_end, repeat_dt_pairs};
76}
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
Input File Parameter
prj__time_loop__processes__process__time_stepping__IterationNumberBasedTimeStepping__multiplier_interpolation_type

Definition at line 17 of file CreateIterationNumberBasedTimeStepping.cpp.

18{
20 config.checkConfigParameter("type", "IterationNumberBasedTimeStepping");
21
23 auto const t_initial = config.getConfigParameter<double>("t_initial");
25 auto const t_end = config.getConfigParameter<double>("t_end");
26 if (t_end < t_initial)
27 {
29 "iteration number based timestepping: t_end({}) is smaller than "
30 "t_initial({})",
31 t_end,
32 t_initial);
33 }
34
36 auto const initial_dt = config.getConfigParameter<double>("initial_dt");
38 auto const minimum_dt = config.getConfigParameter<double>("minimum_dt");
40 auto const maximum_dt = config.getConfigParameter<double>("maximum_dt");
41
42 auto number_iterations =
44 config.getConfigParameter<std::vector<int>>("number_iterations");
45 auto multiplier =
47 config.getConfigParameter<std::vector<double>>("multiplier");
48
49 std::string const multiplier_interpolation_type_string =
51 config.getConfigParameter<std::string>("multiplier_interpolation_type",
52 "PiecewiseConstant");
53 auto const multiplier_interpolation_type =
54 (multiplier_interpolation_type_string == "PiecewiseLinear")
57
58 return {t_initial,
59 t_end,
60 minimum_dt,
61 maximum_dt,
62 initial_dt,
63 multiplier_interpolation_type,
64 std::move(number_iterations),
65 std::move(multiplier)};
66}

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

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 16 of file CreateStaggeredCoupling.cpp.

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

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 12 of file TimeStepAlgorithm.cpp.

15{
16 auto const specific_time = ranges::upper_bound(
17 fixed_output_times, t, ranges::less{}, [](auto t) { return Time(t); });
18
19 if (specific_time == ranges::cend(fixed_output_times))
20 {
21 return dt;
22 }
23
24 Time const fixed_output_time(*specific_time);
25 if ((t < fixed_output_time) && (t + dt) > fixed_output_time)
26 {
27 double const t_to_specific_time = fixed_output_time() - t();
28 return t_to_specific_time;
29 }
30
31 return dt;
32}

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

77{
78 auto const num_nodal_dof = sizeof...(interpolated_values) + 1;
79 auto const num_nodes = shape_matrix_N.size();
80
81 assert(num_nodes * num_nodal_dof ==
82 static_cast<std::size_t>(nodal_values.size()));
83 (void)num_nodal_dof;
84 (void)num_nodes; // no warnings when not in debug build
85
86 detail::shapeFunctionInterpolate<0>(nodal_values, shape_matrix_N,
87 interpolated_value,
88 interpolated_values...);
89}
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)

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

66{
68
69 // We fill the output with zeroes, because filling with NaN
70 // "breaks" visualization, e.g. of heat or mass flow rate
71 // with Taylor-Hood elements. I.e., all lower order
72 // properties would have NaN on the higher order nodes.
73 ranges::fill(output_vector, 0);
74
75 int const n_components =
76 local_to_global_index_map.getNumberOfVariableComponents(variable_id);
77 for (int component = 0; component < n_components; ++component)
78 {
79 auto const& mesh_subset =
80 local_to_global_index_map.getMeshSubset(variable_id, component);
81 for (auto const& l : MeshLib::views::meshLocations(
82 mesh_subset, MeshLib::MeshItemType::Node))
83 {
84 auto const node_id = l.item_id;
85 auto const input_index = local_to_global_index_map.getGlobalIndex(
86 l, variable_id, component);
87 double const value = input_vector[input_index];
88
89 output_vector.getComponent(node_id, component) =
90 map_function(value);
91 }
92 }
93}
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:20
auto meshLocations(Mesh const &mesh, MeshItemType const item_type)
Definition Mesh.h:227

References MeshLib::PropertyVector< PROP_VAL_TYPE >::getComponent(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), NumLib::LocalToGlobalIndexMap::getMeshSubset(), NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents(), MeshLib::views::meshLocations(), 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::span< std::size_t const > 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 98 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 ranges::fill(output_vector_on_submesh, 0);
113
114 int const n_components =
115 local_to_global_index_map.getNumberOfVariableComponents(variable_id);
116 for (int component = 0; component < n_components; ++component)
117 {
118 auto const& mesh_subset =
119 local_to_global_index_map.getMeshSubset(variable_id, component);
120 auto const mesh_id = mesh_subset.getMeshID();
121
122 for (std::size_t submesh_node_id = 0;
123 submesh_node_id < map_submesh_node_id_to_bulk_mesh_node_id.size();
124 ++submesh_node_id)
125 {
126 std::size_t const bulk_node_id =
127 map_submesh_node_id_to_bulk_mesh_node_id[submesh_node_id];
129 bulk_node_id);
130 auto const input_index = local_to_global_index_map.getGlobalIndex(
131 l, variable_id, component);
132
133 // On higher-order meshes some d.o.f.s might not be defined on all
134 // nodes. We silently ignore the d.o.f.s we cannot find.
135 [[unlikely]] if (input_index == NumLib::MeshComponentMap::nop)
136 {
137 continue;
138 }
139
140 double const value = input_vector_on_bulk_mesh[input_index];
141
142 output_vector_on_submesh.getComponent(submesh_node_id, component) =
143 map_function(value);
144 }
145 }
146}

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 101 of file TimeStep.h.

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

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