OGS
NumLib Namespace Reference

Namespaces

namespace  anonymous_namespace{DOFTableUtil.cpp}
 
namespace  anonymous_namespace{LocalToGlobalIndexMap.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
 
class  DefaultIntegrationMethodProvider
 
struct  ElementTraitsLagrange
 
class  EquationSystem
 
class  EvolutionaryPIDcontroller
 
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...
 
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  ISpatialFunction
 Interface class for any functions of spatial coordinates \(f(x,y,z)\). More...
 
class  IterationNumberBasedTimeStepping
 Iteration number based adaptive time stepping. More...
 
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  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  TemplateIsoparametric
 Template class for isoparametric elements. More...
 
class  TimeDiscretization
 
class  TimeDiscretizedODESystem
 
class  TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >
 
class  TimeDiscretizedODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >
 
class  TimeDiscretizedODESystemBase
 
class  TimeStep
 Time step object. More...
 
class  TimeStepAlgorithm
 Interface of time stepping algorithms. More...
 
struct  Vectorial
 
class  VectorProvider
 

Typedefs

using AllElementTraitsLagrange = BaseLib::TMP::Map_t< ElementTraitsLagrange, MeshLib::AllElementTypes >
 
using RelativeEpsilon = BaseLib::StrongType< double, struct RelativeEpsilonTag >
 
using MinimumPerturbation = BaseLib::StrongType< double, struct MinimumPerturbationTag >
 
using NumericalStabilization = std::variant< NoStabilization, IsotropicDiffusionStabilization, FullUpwind, FluxCorrectedTransport >
 

Enumerations

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

Functions

NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters (BaseLib::ConfigTree const &config)
 
GlobalSparsityPattern computeSparsityPattern (LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
 Computes a sparsity pattern for the given inputs.
 
double getNonGhostNodalValue (GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
 
double getNodalValue (GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
 
std::vector< GlobalIndexTypegetIndices (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices (std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< GlobalIndexType > &indices)
 
double norm (GlobalVector const &x, unsigned const global_component, MathLib::VecNormType norm_type, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
 
template<typename Functor >
void transformVariableFromGlobalVector (GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor map_function)
 
template<typename Functor >
void transformVariableFromGlobalVector (GlobalVector const &input_vector_on_bulk_mesh, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector_on_submesh, std::vector< std::size_t > const &map_submesh_node_id_to_bulk_mesh_node_id, Functor map_function)
 
void cleanupGlobalMatrixProviders ()
 
template<typename... Ns_t, typename ElementDOFVector >
auto localDOF (ElementDOFVector const &x)
 
std::ostream & operator<< (std::ostream &os, LocalToGlobalIndexMap const &map)
 
GlobalIndexType getGlobalIndexWithTaylorHoodElement (MeshLib::NodePartitionedMesh const &partitioned_mesh, std::size_t const global_node_id, int const number_of_components_at_base_node, int const number_of_components_at_high_order_node, int const component_id_at_base_node, int const component_id_at_high_order_node, bool const is_base_node)
 
template<typename LocalAssemblerCollection , typename IntegrationPointValuesMethod >
ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection > makeExtrapolatable (LocalAssemblerCollection const &local_assemblers, IntegrationPointValuesMethod integration_point_values_method)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
std::ostream & operator<< (std::ostream &os, const ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Point, ShapePoint1)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Line, ShapeLine2)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Line3, ShapeLine3)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad, ShapeQuad4)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad8, ShapeQuad8)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad9, ShapeQuad9)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Hex, ShapeHex8)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Hex20, ShapeHex20)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tri, ShapeTri3)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tri6, ShapeTri6)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tet, ShapeTet4)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tet10, ShapeTet10)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Prism, ShapePrism6)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Prism15, ShapePrism15)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Pyramid, ShapePyra5)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Pyramid13, ShapePyra13)
 
template<typename ShapeFunction , typename ShapeMatricesType >
NumLib::TemplateIsoparametric< ShapeFunction, ShapeMatricesType > createIsoparametricFiniteElement (MeshLib::Element const &e)
 
template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename PointContainer >
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices (MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
 
template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename IntegrationMethod >
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices (MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
 
template<typename ShapeFunction , typename ShapeMatricesType >
double interpolateXCoordinate (MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
 
template<typename ShapeFunction , typename ShapeMatricesType >
std::array< double, 3 > interpolateCoordinates (MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
 
DefaultIntegrationMethodProvider getIntegrationMethodProvider (NumLib::IntegrationOrder const integration_order)
 
template<typename NodalValues , typename ShapeMatrix , typename... ScalarTypes>
void shapeFunctionInterpolate (const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
 
template<typename LowerOrderShapeFunction , typename HigherOrderMeshElementType , int GlobalDim, typename EigenMatrixType >
void interpolateToHigherOrderNodes (MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)
 
template<typename 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)
 
double computeRelativeNorm (GlobalVector const &x, GlobalVector const &x_prev, MathLib::VecNormType norm_type)
 
std::unique_ptr< TimeDiscretizationcreateTimeDiscretization (BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeStepAlgorithmcreateEvolutionaryPIDcontroller (BaseLib::ConfigTree const &config, std::vector< double > const &fixed_times_for_output)
 
std::unique_ptr< TimeStepAlgorithmcreateFixedTimeStepping (BaseLib::ConfigTree const &config, std::vector< double > const &fixed_times_for_output)
 
std::unique_ptr< TimeStepAlgorithmcreateIterationNumberBasedTimeStepping (BaseLib::ConfigTree const &config, std::vector< double > const &fixed_times_for_output)
 
std::size_t findDeltatInterval (double const t_initial, std::vector< double > const &delta_ts, double const fixed_output_time)
 
void incorporateFixedTimesForOutput (double const t_initial, double const t_end, std::vector< double > &delta_ts, std::vector< double > const &fixed_times_for_output)
 
double possiblyClampDtToNextFixedTime (double 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

◆ MinimumPerturbation

using NumLib::MinimumPerturbation = typedef BaseLib::StrongType<double, struct MinimumPerturbationTag>

Definition at line 22 of file NumericalDifferentiation.h.

◆ NumericalStabilization

◆ RelativeEpsilon

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

Definition at line 21 of file NumericalDifferentiation.h.

Enumeration Type Documentation

◆ ComponentOrder

enum class NumLib::ComponentOrder
strong

Ordering of components in global matrix/vector.

Enumerator
BY_COMPONENT 

Ordering data by component type.

BY_LOCATION 

Ordering data by spatial location.

Definition at line 22 of file MeshComponentMap.h.

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

◆ ShapeMatrixType

enum class NumLib::ShapeMatrixType
strong

Shape matrix type to be calculated.

Enumerator

calculates N

DNDR 

calculates dNdr

N_J 

calculates N, dNdr, J, and detJ

DNDR_J 

calculates dNdr, J, and detJ

DNDX 

calculates dNdr, J, detJ, invJ, and dNdx

ALL 

calculates all

Definition at line 23 of file ShapeMatrices.h.

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

Function Documentation

◆ assembleAdvectionMatrix()

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

88{
89 std::visit(
90 [&](auto&& stabilizer)
91 {
92 using Stabilizer = std::decay_t<decltype(stabilizer)>;
93 if constexpr (std::is_same_v<Stabilizer, FullUpwind>)
94 {
95 if (average_velocity > stabilizer.getCutoffVelocity())
96 {
97 detail::applyFullUpwind(ip_data_vector, ip_flux_vector,
98 laplacian_matrix);
99 return;
100 }
101 }
102
103 detail::assembleAdvectionMatrix(ip_data_vector, ip_flux_vector,
104 laplacian_matrix);
105 },
106 stabilizer);
107}

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

◆ canReduceTimestepSize()

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

Definition at line 39 of file TimeStepAlgorithm.cpp.

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

References NumLib::TimeStep::dt().

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

◆ checkRelativeTolerance()

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

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

Definition at line 48 of file ConvergenceCriterion.cpp.

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

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

◆ cleanupGlobalMatrixProviders()

void NumLib::cleanupGlobalMatrixProviders ( )

Definition at line 29 of file GlobalMatrixProviders.cpp.

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

References globalSetupGlobalMatrixVectorProvider.

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

◆ computeFluxCorrectedTransport()

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

Definition at line 211 of file FluxCorrectedTransport.h.

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

References NumLib::detail::calculateFluxCorrectedTransport().

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

◆ computeHydrodynamicDispersion()

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

Definition at line 71 of file HydrodynamicDispersion.h.

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

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

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

◆ computeRelativeNorm()

double NumLib::computeRelativeNorm ( GlobalVector const &  x,
GlobalVector const &  x_prev,
MathLib::VecNormType  norm_type 
)

Compute and return the relative norm of solutions between two successive time steps by \( \|u^{n+1}-u^{n}\|/\|u^{n+1}\| \).

Parameters
xThe current solution
x_prevThe previous solution
norm_typeThe norm type of global vector
Returns
\( \|u^{n+1}-u^{n}\|/\|u^{n+1}\| \).

Definition at line 18 of file TimeDiscretization.cpp.

21{
22 if (norm_type == MathLib::VecNormType::INVALID)
23 {
24 OGS_FATAL("An invalid norm type has been passed");
25 }
26
27 // Stores \f$ u_{n+1}-u_{n}\f$.
28 GlobalVector dx;
29 MathLib::LinAlg::copy(x, dx); // copy x to dx.
30
31 // dx = x - x_prev --> x - dx --> dx
32 MathLib::LinAlg::axpy(dx, -1.0, x_prev);
33 const double norm_dx = MathLib::LinAlg::norm(dx, norm_type);
34
35 const double norm_x = MathLib::LinAlg::norm(x, norm_type);
36 if (norm_x > std::numeric_limits<double>::epsilon())
37 {
38 return norm_dx / norm_x;
39 }
40
41 // Both of norm_x and norm_dx are close to zero
42 if (norm_dx < std::numeric_limits<double>::epsilon())
43 {
44 return 1.0;
45 }
46
47 // Only norm_x is close to zero
48 return norm_dx / std::numeric_limits<double>::epsilon();
49}
#define OGS_FATAL(...)
Definition: Error.h:26
Global vector based on Eigen vector.
Definition: EigenVector.h:25
double norm(MatrixOrVector const &x, MathLib::VecNormType type)
Definition: LinAlg.h:93
void copy(PETScVector const &x, PETScVector &y)
Definition: LinAlg.cpp:37
void axpy(PETScVector &y, PetscScalar const a, PETScVector const &x)
Definition: LinAlg.cpp:57

References MathLib::LinAlg::axpy(), MathLib::LinAlg::copy(), MathLib::INVALID, MathLib::LinAlg::norm(), and OGS_FATAL.

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

◆ computeShapeMatrices()

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

Definition at line 25 of file InitShapeMatrices.h.

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

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

◆ computeSparsityPattern()

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

Computes a sparsity pattern for the given inputs.

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

Definition at line 74 of file ComputeSparsityPattern.cpp.

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

References computeSparsityPatternPETSc().

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

◆ createConvergenceCriterion()

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

Creates a convergence criterion from the given configuration.

Input File Parameter:
prj__time_loop__processes__process__convergence_criterion__type

Definition at line 22 of file ConvergenceCriterion.cpp.

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

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

Referenced by ProcessLib::createPerProcessData().

◆ createConvergenceCriterionDeltaX()

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

Definition at line 61 of file ConvergenceCriterionDeltaX.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionPerComponentDeltaX()

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

Definition at line 91 of file ConvergenceCriterionPerComponentDeltaX.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionPerComponentResidual()

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

Definition at line 128 of file ConvergenceCriterionPerComponentResidual.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionResidual()

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

Definition at line 95 of file ConvergenceCriterionResidual.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createEvolutionaryPIDcontroller()

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

Create an EvolutionaryPIDcontroller time stepper from the given configuration

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

Definition at line 22 of file CreateEvolutionaryPIDcontroller.cpp.

25{
27 config.checkConfigParameter("type", "EvolutionaryPIDcontroller");
28
30 auto const t0 = config.getConfigParameter<double>("t_initial");
32 auto const t_end = config.getConfigParameter<double>("t_end");
34 auto const h0 = config.getConfigParameter<double>("dt_guess");
35
37 auto const h_min = config.getConfigParameter<double>("dt_min");
39 auto const h_max = config.getConfigParameter<double>("dt_max");
41 auto const rel_h_min = config.getConfigParameter<double>("rel_dt_min");
43 auto const rel_h_max = config.getConfigParameter<double>("rel_dt_max");
44
46 auto const tol = config.getConfigParameter<double>("tol");
47
48 return std::make_unique<EvolutionaryPIDcontroller>(t0,
49 t_end,
50 h0,
51 h_min,
52 h_max,
53 rel_h_min,
54 rel_h_max,
55 tol,
56 fixed_times_for_output);
57}

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

Referenced by createTimeStepper().

◆ createFixedTimeStepping()

std::unique_ptr< TimeStepAlgorithm > NumLib::createFixedTimeStepping ( BaseLib::ConfigTree const &  config,
std::vector< double > const &  fixed_times_for_output 
)

Create a FixedTimeStepping time stepper from the given configuration

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

Definition at line 21 of file CreateFixedTimeStepping.cpp.

24{
26 config.checkConfigParameter("type", "FixedTimeStepping");
27
29 auto const t_initial = config.getConfigParameter<double>("t_initial");
31 auto const t_end = config.getConfigParameter<double>("t_end");
33 auto const delta_ts_config = config.getConfigSubtree("timesteps");
34
35 // TODO: consider adding call "listNonEmpty" to config tree
37 auto const range = delta_ts_config.getConfigSubtreeList("pair");
38 if (range.begin() == range.end())
39 {
40 OGS_FATAL("no timesteps have been given");
41 }
42
43 std::vector<std::pair<std::size_t, double>> repeat_dt_pairs;
44 for (auto const pair : range)
45 {
46 repeat_dt_pairs.emplace_back(
48 pair.getConfigParameter<std::size_t>("repeat"),
50 pair.getConfigParameter<double>("delta_t"));
51 }
52
53 return std::make_unique<FixedTimeStepping>(
54 t_initial, t_end, repeat_dt_pairs, fixed_times_for_output);
55}

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

Referenced by createTimeStepper().

◆ createIsoparametricFiniteElement()

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

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

Definition at line 161 of file TemplateIsoparametric.h.

162{
163 using FemType =
165
166 return FemType{e};
167}
Template class for isoparametric elements.

Referenced by ProcessLib::BoundaryConditionAndSourceTerm::Python::BcAndStLocalAssemblerImpl< BcOrStData, ShapeFunction, LowerOrderShapeFunction, GlobalDim >::assemble().

◆ createIterationNumberBasedTimeStepping()

std::unique_ptr< TimeStepAlgorithm > NumLib::createIterationNumberBasedTimeStepping ( BaseLib::ConfigTree const &  config,
std::vector< double > const &  fixed_times_for_output 
)

Create a IterationNumberBasedTimeStepping time stepper from the given configuration.

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

Definition at line 22 of file CreateIterationNumberBasedTimeStepping.cpp.

25{
27 config.checkConfigParameter("type", "IterationNumberBasedTimeStepping");
28
30 auto const t_initial = config.getConfigParameter<double>("t_initial");
32 auto const t_end = config.getConfigParameter<double>("t_end");
34 auto const initial_dt = config.getConfigParameter<double>("initial_dt");
36 auto const minimum_dt = config.getConfigParameter<double>("minimum_dt");
38 auto const maximum_dt = config.getConfigParameter<double>("maximum_dt");
39
40 auto number_iterations =
42 config.getConfigParameter<std::vector<int>>("number_iterations");
43 auto multiplier =
45 config.getConfigParameter<std::vector<double>>("multiplier");
46
47 return std::make_unique<IterationNumberBasedTimeStepping>(
48 t_initial, t_end, minimum_dt, maximum_dt, initial_dt,
49 std::move(number_iterations), std::move(multiplier),
50 fixed_times_for_output);
51}

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

Referenced by createTimeStepper().

◆ createNewtonRaphsonSolverParameters()

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

Definition at line 17 of file CreateNewtonRaphsonSolverParameters.cpp.

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

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

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

◆ createNumericalStabilization()

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

Definition at line 20 of file CreateNumericalStabilization.cpp.

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

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

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

◆ createTimeDiscretization()

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

Definition at line 19 of file TimeDiscretizationBuilder.cpp.

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

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

Referenced by ProcessLib::createPerProcessData().

◆ createTimeStepper()

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

Definition at line 26 of file CreateTimeStepper.cpp.

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

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

Referenced by ProcessLib::createPerProcessData().

◆ findDeltatInterval()

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

Definition at line 51 of file FixedTimeStepping.cpp.

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

Referenced by incorporateFixedTimesForOutput().

◆ getGlobalIndexWithTaylorHoodElement()

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

Definition at line 326 of file MeshComponentMap.cpp.

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

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

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

◆ getIndices()

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

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

Definition at line 124 of file DOFTableUtil.cpp.

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

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

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

◆ getIntegrationMethodProvider()

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

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

Definition at line 55 of file IntegrationMethodProvider.h.

◆ getNodalValue()

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

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

Definition at line 110 of file DOFTableUtil.cpp.

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

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

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

◆ getNonGhostNodalValue()

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

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

Definition at line 91 of file DOFTableUtil.cpp.

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

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

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

◆ getRowColumnIndices()

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

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

Definition at line 143 of file DOFTableUtil.cpp.

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

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

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

◆ incorporateFixedTimesForOutput()

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

Definition at line 74 of file FixedTimeStepping.cpp.

77{
78 if (fixed_times_for_output.empty())
79 {
80 return;
81 }
82
83 if (auto lower_bound =
84 std::lower_bound(begin(fixed_times_for_output),
85 end(fixed_times_for_output), t_initial);
86 lower_bound != begin(fixed_times_for_output))
87 {
88 WARN(
89 "Request for output at times {}, but the simulation's start time "
90 "is {}. Output will be skipped.",
91 fmt::join(begin(fixed_times_for_output), lower_bound, ", "),
92 t_initial);
93 }
94
95 if (auto upper_bound = 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 =
116 findDeltatInterval(t_initial, delta_ts, 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 auto const lower_bound = std::accumulate(
124 begin(delta_ts), begin(delta_ts) + interval_number, t_initial);
125 auto const upper_bound = lower_bound + delta_ts[interval_number];
126 if (fixed_time_for_output - lower_bound <=
127 std::numeric_limits<double>::epsilon())
128 {
129 continue;
130 }
131 if (upper_bound - fixed_time_for_output <=
132 std::numeric_limits<double>::epsilon())
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(double const t_initial, std::vector< double > const &delta_ts, double const fixed_output_time)

References findDeltatInterval(), and WARN().

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

◆ initShapeMatrices()

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

Definition at line 53 of file InitShapeMatrices.h.

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

References computeShapeMatrices().

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

◆ interpolateCoordinates()

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

Definition at line 82 of file InitShapeMatrices.h.

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

References N.

Referenced by ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::ThermoRichardsFlowLocalAssembler(), ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >::assemble(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble(), ProcessLib::NeumannBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::RobinBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::computeSecondaryVariableConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete(), ProcessLib::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete(), ProcessLib::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(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables().

◆ interpolateToHigherOrderNodes()

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

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

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

Definition at line 107 of file Interpolation.h.

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

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

Referenced by ProcessLib::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(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >::computeSecondaryVariableConcrete(), and ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::postTimestepConcreteWithBlockVectors().

◆ interpolateXCoordinate()

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

Definition at line 71 of file InitShapeMatrices.h.

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

References N.

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

◆ localDOF()

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

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

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

Definition at line 64 of file LocalDOF.h.

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

References NumLib::detail::localDOFImpl().

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

◆ makeExtrapolatable()

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

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

Definition at line 149 of file ExtrapolatableElementCollection.h.

Referenced by ProcessLib::makeExtrapolator().

◆ norm()

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

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

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

Definition at line 163 of file DOFTableUtil.cpp.

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

References MathLib::INFINITY_N, MathLib::NORM1, MathLib::NORM2, and OGS_FATAL.

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

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [1/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Hex  ,
ShapeHex8   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [2/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Hex20  ,
ShapeHex20   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [3/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Line  ,
ShapeLine2   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [4/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Line3  ,
ShapeLine3   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [5/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Point  ,
ShapePoint1   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [6/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Prism  ,
ShapePrism6   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [7/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Prism15  ,
ShapePrism15   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [8/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Pyramid  ,
ShapePyra5   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [9/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Pyramid13  ,
ShapePyra13   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [10/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Quad  ,
ShapeQuad4   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [11/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Quad8  ,
ShapeQuad8   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [12/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Quad9  ,
ShapeQuad9   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [13/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tet  ,
ShapeTet4   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [14/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tet10  ,
ShapeTet10   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [15/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tri  ,
ShapeTri3   
)

◆ OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE() [16/16]

NumLib::OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE ( Tri6  ,
ShapeTri6   
)

◆ operator<<() [1/2]

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

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

131{
132 shape.write(os);
133 return os;
134}
void write(std::ostream &out) const

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

◆ operator<<() [2/2]

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

Definition at line 454 of file LocalToGlobalIndexMap.cpp.

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

◆ possiblyClampDtToNextFixedTime()

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

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

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

Definition at line 17 of file TimeStepAlgorithm.cpp.

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

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

◆ shapeFunctionInterpolate()

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

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

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

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

Definition at line 80 of file Interpolation.h.

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

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

63{
65
66 // We fill the output with zeroes, because filling with NaN
67 // "breaks" visualization, e.g. of heat or mass flow rate
68 // with Taylor-Hood elements. I.e., all lower order
69 // properties would have NaN on the higher order nodes.
70 std::fill(begin(output_vector), end(output_vector), 0);
71
72 int const n_components =
73 local_to_global_index_map.getNumberOfVariableComponents(variable_id);
74 for (int component = 0; component < n_components; ++component)
75 {
76 auto const& mesh_subset =
77 local_to_global_index_map.getMeshSubset(variable_id, component);
78 auto const mesh_id = mesh_subset.getMeshID();
79 for (auto const& node : mesh_subset.getNodes())
80 {
81 auto const node_id = node->getID();
83 node_id);
84 auto const input_index = local_to_global_index_map.getGlobalIndex(
85 l, variable_id, component);
86 double const value = input_vector[input_index];
87
88 output_vector.getComponent(node_id, component) =
89 map_function(value);
90 }
91 }
92}
PROP_VAL_TYPE & getComponent(std::size_t tuple_index, int component)
Returns the value for the given component stored in the given tuple.
void setLocalAccessibleVector(PETScVector const &x)
Definition: LinAlg.cpp:27

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

◆ transformVariableFromGlobalVector() [2/2]

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

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

Definition at line 97 of file DOFTableUtil.h.

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

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

114{
115 previous_timestep = current_timestep;
116 current_timestep += dt;
117}

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