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
 
struct  CouplingNode
 Information of a coupling node. More...
 
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  IterationNumberBasedTimeStepping
 Iteration number based adaptive time stepping. More...
 
struct  LocalCouplingParameters
 
class  LocalLinearLeastSquaresExtrapolator
 
class  LocalToGlobalIndexMap
 
struct  LowerDim
 
struct  LowerDim< NumLib::ShapeHex20 >
 
struct  LowerDim< NumLib::ShapeLine3 >
 
struct  LowerDim< NumLib::ShapePrism15 >
 
struct  LowerDim< NumLib::ShapePyra13 >
 
struct  LowerDim< NumLib::ShapeQuad8 >
 
struct  LowerDim< NumLib::ShapeQuad9 >
 
struct  LowerDim< NumLib::ShapeTet10 >
 
struct  LowerDim< NumLib::ShapeTri6 >
 
class  MatrixProvider
 
class  MatrixTranslator
 
class  MatrixTranslator< ODESystemTag::FirstOrderImplicitQuasilinear >
 
class  MatrixTranslatorGeneral
 
class  MatrixTranslatorGeneral< ODESystemTag::FirstOrderImplicitQuasilinear >
 
class  MeshComponentMap
 Multidirectional mapping between mesh entities and degrees of freedom. More...
 
struct  NaturalCoordinates
 
struct  NaturalCoordinates< MeshLib::Hex >
 
struct  NaturalCoordinates< MeshLib::Hex20 >
 
struct  NaturalCoordinates< MeshLib::Line >
 
struct  NaturalCoordinates< MeshLib::Line3 >
 
struct  NaturalCoordinates< MeshLib::Point >
 
struct  NaturalCoordinates< MeshLib::Prism >
 
struct  NaturalCoordinates< MeshLib::Prism15 >
 
struct  NaturalCoordinates< MeshLib::Pyramid >
 
struct  NaturalCoordinates< MeshLib::Pyramid13 >
 
struct  NaturalCoordinates< MeshLib::Quad >
 
struct  NaturalCoordinates< MeshLib::Quad8 >
 
struct  NaturalCoordinates< MeshLib::Quad9 >
 
struct  NaturalCoordinates< MeshLib::Tet >
 
struct  NaturalCoordinates< MeshLib::Tet10 >
 
struct  NaturalCoordinates< MeshLib::Tri >
 
struct  NaturalCoordinates< MeshLib::Tri6 >
 
struct  NaturalCoordinatesMapping
 
class  NewtonRaphson
 
struct  NewtonRaphsonSolverParameters
 
class  NonlinearSolver
 
class  NonlinearSolver< NonlinearSolverTag::Newton >
 
class  NonlinearSolver< NonlinearSolverTag::Picard >
 
class  NonlinearSolverBase
 
struct  NonlinearSolverStatus
 Status of the non-linear solver. More...
 
class  NonlinearSystem
 
class  NonlinearSystem< NonlinearSolverTag::Newton >
 
class  NonlinearSystem< NonlinearSolverTag::Picard >
 
struct  NoStabilization
 
struct  NumericalDerivative
 
class  ODESystem
 
class  ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Newton >
 
class  ODESystem< ODESystemTag::FirstOrderImplicitQuasilinear, NonlinearSolverTag::Picard >
 
class  PETScNonlinearSolver
 
class  ReferenceElement
 
struct  RootCouplingNode
 
struct  SerialExecutor
 
class  ShapeHex20
 
class  ShapeHex8
 
class  ShapeLine2
 
class  ShapeLine3
 
struct  ShapeMatrices
 Coordinates mapping matrices at particular location. More...
 
class  ShapeMatrixCache
 
class  ShapePoint1
 Shape function for a point element in natural coordinates. More...
 
class  ShapePrism15
 
class  ShapePrism6
 
class  ShapePyra13
 
class  ShapePyra5
 
class  ShapeQuad4
 
class  ShapeQuad8
 
class  ShapeQuad9
 
class  ShapeTet10
 
class  ShapeTet4
 
class  ShapeTri3
 
class  ShapeTri6
 
class  SimpleMatrixVectorProvider
 
class  StaggeredCoupling
 
class  TemplateIsoparametric
 Template class for isoparametric elements. More...
 
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
 
using RelativeEpsilon = BaseLib::StrongType<double, struct RelativeEpsilonTag>
 
using MinimumPerturbation
 
using NumericalStabilization
 
using CouplingNodeVariant = std::variant<CouplingNode, RootCouplingNode>
 

Enumerations

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

Functions

NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters (BaseLib::ConfigTree const &config)
 
GlobalSparsityPattern computeSparsityPattern (LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
 Computes a sparsity pattern for the given inputs.
 
double getNonGhostNodalValue (GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
 
double getNodalValue (GlobalVector const &x, MeshLib::Mesh const &mesh, NumLib::LocalToGlobalIndexMap const &dof_table, std::size_t const node_id, std::size_t const global_component_id)
 
std::vector< GlobalIndexTypegetIndices (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices (std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< GlobalIndexType > &indices)
 
double norm (GlobalVector const &x, unsigned const global_component, MathLib::VecNormType norm_type, LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
 
Eigen::VectorXd getLocalX (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x)
 
template<typename Functor >
void transformVariableFromGlobalVector (GlobalVector const &input_vector, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector, Functor map_function)
 
template<typename Functor >
void transformVariableFromGlobalVector (GlobalVector const &input_vector_on_bulk_mesh, int const variable_id, NumLib::LocalToGlobalIndexMap const &local_to_global_index_map, MeshLib::PropertyVector< double > &output_vector_on_submesh, std::vector< std::size_t > const &map_submesh_node_id_to_bulk_mesh_node_id, Functor map_function)
 
void cleanupGlobalMatrixProviders ()
 
template<typename... Ns_t, typename ElementDOFVector >
auto localDOF (ElementDOFVector const &x)
 
std::ostream & operator<< (std::ostream &os, LocalToGlobalIndexMap const &map)
 
GlobalIndexType getGlobalIndexWithTaylorHoodElement (MeshLib::NodePartitionedMesh const &partitioned_mesh, std::size_t const global_node_id, int const number_of_components_at_base_node, int const number_of_components_at_high_order_node, int const component_id_at_base_node, int const component_id_at_high_order_node, bool const is_base_node)
 
template<typename LocalAssemblerCollection , typename IntegrationPointValuesMethod >
ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection > makeExtrapolatable (LocalAssemblerCollection const &local_assemblers, IntegrationPointValuesMethod integration_point_values_method)
 
template<class T_N , class T_DNDR , class T_J , class T_DNDX >
std::ostream & operator<< (std::ostream &os, const ShapeMatrices< T_N, T_DNDR, T_J, T_DNDX > &shape)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Point, ShapePoint1)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Line, ShapeLine2)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Line3, ShapeLine3)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad, ShapeQuad4)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad8, ShapeQuad8)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Quad9, ShapeQuad9)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Hex, ShapeHex8)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Hex20, ShapeHex20)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tri, ShapeTri3)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tri6, ShapeTri6)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tet, ShapeTet4)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Tet10, ShapeTet10)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Prism, ShapePrism6)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Prism15, ShapePrism15)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Pyramid, ShapePyra5)
 
 OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE (Pyramid13, ShapePyra13)
 
template<typename ShapeFunction , typename ShapeMatricesType >
NumLib::TemplateIsoparametric< ShapeFunction, ShapeMatricesType > createIsoparametricFiniteElement (MeshLib::Element const &e)
 
template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename PointContainer >
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices (MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
 
template<typename ShapeFunction , typename ShapeMatricesType , int GlobalDim, ShapeMatrixType SelectedShapeMatrixType = ShapeMatrixType::ALL, typename IntegrationMethod >
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices (MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
 
template<typename ShapeFunction , typename ShapeMatricesType >
double interpolateXCoordinate (MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
 
template<typename ShapeFunction , typename ShapeMatricesType >
std::array< double, 3 > interpolateCoordinates (MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
 
DefaultIntegrationMethodProvider getIntegrationMethodProvider (NumLib::IntegrationOrder const integration_order)
 
template<typename NodalValues , typename ShapeMatrix , typename... ScalarTypes>
void shapeFunctionInterpolate (const NodalValues &nodal_values, const ShapeMatrix &shape_matrix_N, double &interpolated_value, ScalarTypes &... interpolated_values)
 
template<typename LowerOrderShapeFunction , typename HigherOrderMeshElementType , int GlobalDim, typename EigenMatrixType >
void interpolateToHigherOrderNodes (MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)
 
template<typename MeshElementType , typename IPData , typename FluxVectorType , typename Derived >
void assembleAdvectionMatrix (NumericalStabilization const &stabilizer, IPData const &ip_data_vector, NumLib::ShapeMatrixCache const &shape_matrix_cache, std::vector< FluxVectorType > const &ip_flux_vector, double const average_velocity, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
template<typename IPData , typename FluxVectorType , typename Derived >
void assembleAdvectionMatrix (NumericalStabilization const &stabilizer, IPData const &ip_data_vector, std::vector< FluxVectorType > const &ip_flux_vector, double const average_velocity, Eigen::MatrixBase< Derived > &laplacian_matrix)
 
NumericalStabilization createNumericalStabilization (MeshLib::Mesh const &mesh, BaseLib::ConfigTree const &config)
 
void computeFluxCorrectedTransport (NumericalStabilization const &stabilizer, const double t, const double dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, const MathLib::MatrixSpecifications &matrix_specification, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)
 
Eigen::MatrixXd computeHydrodynamicDispersion (NumericalStabilization const &stabilizer, std::size_t const element_id, Eigen::MatrixXd const &pore_diffusion_coefficient, Eigen::VectorXd const &velocity, double const porosity, double const solute_dispersivity_transverse, double const solute_dispersivity_longitudinal)
 
std::unique_ptr< ConvergenceCriterioncreateConvergenceCriterion (BaseLib::ConfigTree const &config)
 Creates a convergence criterion from the given configuration.
 
bool checkRelativeTolerance (const double reltol, const double numerator, const double denominator)
 
std::unique_ptr< ConvergenceCriterionDeltaXcreateConvergenceCriterionDeltaX (const BaseLib::ConfigTree &config)
 
std::unique_ptr< ConvergenceCriterionPerComponentDeltaXcreateConvergenceCriterionPerComponentDeltaX (const BaseLib::ConfigTree &config)
 
std::unique_ptr< ConvergenceCriterionPerComponentResidualcreateConvergenceCriterionPerComponentResidual (const BaseLib::ConfigTree &config)
 
std::unique_ptr< ConvergenceCriterionResidualcreateConvergenceCriterionResidual (const BaseLib::ConfigTree &config)
 
template<ODESystemTag ODETag>
std::unique_ptr< MatrixTranslator< ODETag > > createMatrixTranslator (TimeDiscretization const &timeDisc)
 
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTagcreateNonlinearSolver (GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
 
std::unique_ptr< TimeDiscretizationcreateTimeDiscretization (BaseLib::ConfigTree const &config)
 
template<typename ProcessData >
void checkLocalCouplingParameters (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters)
 
template<typename ProcessData >
std::vector< CouplingNodeVariantcreateRegularCouplingNodes (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
 Create coupling nodes that do not have local-coupling nodes.
 
template<typename ProcessData >
std::vector< CouplingNodeVariantcreateRootCouplingNodes (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
 Create coupling nodes that have local-coupling nodes.
 
template<typename ProcessData >
std::vector< CouplingNodeVariantcreateCouplingNodes (std::vector< std::unique_ptr< ProcessData > > const &per_process_data, std::vector< LocalCouplingParameters > const &all_local_coupling_parameters, int const global_max_coupling_iterations, std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > > &global_coupling_conv_criteria)
 
template<typename ProcessData >
std::unique_ptr< StaggeredCouplingcreateStaggeredCoupling (BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ProcessData > > const &per_process_data)
 Create a StaggeredCoupling instance from the given configuration.
 
std::vector< LocalCouplingParametersparseLocalCoupling (BaseLib::ConfigTree const &config, const std::size_t max_process_number)
 
std::tuple< std::vector< std::unique_ptr< NumLib::ConvergenceCriterion > >, std::vector< LocalCouplingParameters >, int > parseCoupling (BaseLib::ConfigTree const &config)
 
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

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

Definition at line 100 of file ElementTraitsLagrange.h.

◆ CouplingNodeVariant

◆ MinimumPerturbation

◆ NumericalStabilization

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

Definition at line 31 of file CreateNumericalStabilization.h.

◆ RelativeEpsilon

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

Definition at line 21 of file NumericalDifferentiation.h.

Enumeration Type Documentation

◆ ComponentOrder

enum class NumLib::ComponentOrder
strong

Ordering of components in global matrix/vector.

Enumerator
BY_COMPONENT 

Ordering data by component type.

BY_LOCATION 

Ordering data by spatial location.

Definition at line 22 of file MeshComponentMap.h.

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

◆ ShapeMatrixType

enum class NumLib::ShapeMatrixType
strong

Shape matrix type to be calculated.

Enumerator

calculates N

DNDR 

calculates dNdr

N_J 

calculates N, dNdr, J, and detJ

DNDR_J 

calculates dNdr, J, and detJ

DNDX 

calculates dNdr, J, detJ, invJ, and dNdx

ALL 

calculates all

Definition at line 23 of file ShapeMatrices.h.

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

Function Documentation

◆ assembleAdvectionMatrix() [1/2]

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

Definition at line 109 of file AdvectionMatrixAssembler.h.

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

References NumLib::detail::applyFullUpwind().

◆ assembleAdvectionMatrix() [2/2]

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

Definition at line 138 of file AdvectionMatrixAssembler.h.

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

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

◆ canReduceTimestepSize()

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

Definition at line 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().

◆ checkLocalCouplingParameters()

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

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

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

References OGS_FATAL.

Referenced by createCouplingNodes().

◆ checkRelativeTolerance()

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

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

Definition at line 48 of file ConvergenceCriterion.cpp.

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

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

◆ cleanupGlobalMatrixProviders()

void NumLib::cleanupGlobalMatrixProviders ( )

Definition at line 29 of file GlobalMatrixProviders.cpp.

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

References globalSetupGlobalMatrixVectorProvider.

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

◆ computeFluxCorrectedTransport()

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

Definition at line 211 of file FluxCorrectedTransport.h.

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

References NumLib::detail::calculateFluxCorrectedTransport().

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

◆ computeHydrodynamicDispersion()

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

Definition at line 71 of file HydrodynamicDispersion.h.

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

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

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

◆ computeShapeMatrices()

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

Definition at line 25 of file InitShapeMatrices.h.

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

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
VecNormType convertStringToVecNormType(const std::string &str)
convert string to VecNormType

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

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionPerComponentDeltaX()

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

Definition at line 91 of file ConvergenceCriterionPerComponentDeltaX.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionPerComponentResidual()

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

Definition at line 128 of file ConvergenceCriterionPerComponentResidual.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createConvergenceCriterionResidual()

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

Definition at line 95 of file ConvergenceCriterionResidual.cpp.

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

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

Referenced by createConvergenceCriterion().

◆ createCouplingNodes()

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

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

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

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

Referenced by createStaggeredCoupling().

◆ createEvolutionaryPIDcontroller()

std::unique_ptr< TimeStepAlgorithm > NumLib::createEvolutionaryPIDcontroller ( 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().

◆ createRegularCouplingNodes()

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

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

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

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

References NumLib::CouplingNode::process_id.

Referenced by createCouplingNodes().

◆ createRootCouplingNodes()

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

Create coupling nodes that have local-coupling nodes.

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

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

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

Referenced by createCouplingNodes().

◆ createStaggeredCoupling()

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

Create a StaggeredCoupling instance from the given configuration.

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

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

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

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

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

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(), getLocalX(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::initializeChemicalSystem(), ProcessLib::VolumetricSourceTermLocalAssembler< ShapeFunction, GlobalDim >::integrate(), ProcessLib::VectorMatrixAssembler::preAssemble(), ProcessLib::LocalAssemblerInterface::preTimestep(), ProcessLib::ComponentTransport::ComponentTransportLocalAssemblerInterface::setChemicalSystem(), and ProcessLib::SmallDeformation::writeMaterialForces().

◆ getIntegrationMethodProvider()

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

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

Definition at line 55 of file IntegrationMethodProvider.h.

◆ getLocalX()

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

Definition at line 183 of file DOFTableUtil.cpp.

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

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

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

◆ getNodalValue()

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

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

Definition at line 113 of file DOFTableUtil.cpp.

117{
119 node_id};
120
121 auto const index = dof_table.getGlobalIndex(l, global_component_id);
122 assert(index != NumLib::MeshComponentMap::nop);
123
124 return x.get(index);
125}
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 94 of file DOFTableUtil.cpp.

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

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

150{
151 assert(dof_table.size() > id);
152 indices.clear();
153
154 // Local matrices and vectors will always be ordered by component,
155 // no matter what the order of the global matrix is.
156 for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c)
157 {
158 auto const& idcs = dof_table(id, c).rows;
159 indices.reserve(indices.size() + idcs.size());
160 indices.insert(indices.end(), idcs.begin(), idcs.end());
161 }
162
164}
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 TimeStep::minimalTimeStepSize)
128 {
129 continue;
130 }
131 if (upper_bound - fixed_time_for_output <=
132 TimeStep::minimalTimeStepSize)
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(), NumLib::TimeStep::minimalTimeStepSize, 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::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::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >::setInitialConditionsConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim, ConstitutiveTraits >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariablesDerivatives().

◆ interpolateToHigherOrderNodes()

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

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

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

Definition at line 107 of file Interpolation.h.

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

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

Referenced by ProcessLib::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::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::LargeDeformation::LargeDeformationLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete(), ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerMatrix< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::postTimestepConcreteWithBlockVectors(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >::preAssemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveRelations(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::updateConstitutiveVariables().

◆ localDOF()

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

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

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

Definition at line 64 of file LocalDOF.h.

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

References NumLib::detail::localDOFImpl().

Referenced by ProcessLib::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 166 of file DOFTableUtil.cpp.

169{
170 switch (norm_type)
171 {
173 return norm1(x, global_component, dof_table, mesh);
175 return norm2(x, global_component, dof_table, mesh);
177 return normInfinity(x, global_component, dof_table, mesh);
178 default:
179 OGS_FATAL("An invalid norm type has been passed.");
180 }
181}

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}

◆ parseCoupling()

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

Definition at line 105 of file CreateStaggeredCoupling.cpp.

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

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

Referenced by createStaggeredCoupling().

◆ parseLocalCoupling()

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

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

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

Definition at line 24 of file CreateStaggeredCoupling.cpp.

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

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

Referenced by parseCoupling().

◆ possiblyClampDtToNextFixedTime()

double NumLib::possiblyClampDtToNextFixedTime ( 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 61 of file DOFTableUtil.h.

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

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

◆ transformVariableFromGlobalVector() [2/2]

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

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

Definition at line 99 of file DOFTableUtil.h.

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

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

◆ updateTimeSteps()

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

Definition at line 116 of file TimeStep.h.

118{
119 previous_timestep = current_timestep;
120 current_timestep += dt;
121}

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