OGS 6.2.0-244-g47b8a9a9d
NumLib::SerialExecutor Struct Reference

Detailed Description

Definition at line 22 of file SerialExecutor.h.

#include <SerialExecutor.h>

Static Public Member Functions

template<typename F , typename C , typename... Args_>
static void executeDereferenced (F const &f, C const &c, Args_ &&... args)
 
template<typename Container , typename Object , typename Method , typename... Args>
static void executeMemberDereferenced (Object &object, Method method, Container const &container, Args &&... args)
 
template<typename Container , typename Object , typename Method , typename... Args>
static void executeSelectedMemberDereferenced (Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
 
template<typename Container , typename Method , typename... Args>
static void executeMemberOnDereferenced (Method method, Container const &container, Args &&... args)
 
template<typename Container , typename Method , typename... Args>
static void executeSelectedMemberOnDereferenced (Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
 
template<typename F , typename C , typename Data , typename... Args_>
static void transformDereferenced (F const &f, C const &c, Data &data, Args_ &&... args)
 

Member Function Documentation

◆ executeDereferenced()

template<typename F , typename C , typename... Args_>
static void NumLib::SerialExecutor::executeDereferenced ( F const &  f,
C const &  c,
Args_ &&...  args 
)
inlinestatic

Executes f for each element from the input container.

The elements of c are dereferenced before being passed to f. Return values of the function call are ignored.

Note
This function is intended to be used if f is a plain function, a static class method, a lambda or an object having a call operator defined. For non-static member functions you are encouraged to use executeMemberDereferenced(), if applicable.
Template Parameters
Ftype of the callback function f.
Cinput container type.
Argstypes additional arguments passed to f.
Parameters
fa function that accepts a reference to container's elements, an index as arguments (and possibly further arguments).
ca container supporting access over operator[]. The elements of c must have pointer semantics, i.e., support dereferencing via unary operator*().
argsadditional arguments passed to f.

Definition at line 49 of file SerialExecutor.h.

Referenced by ProcessLib::TES::TESProcess::postIterationConcreteProcess(), and ProcessLib::SmallDeformation::writeMaterialForces().

50  {
51  for (std::size_t i = 0; i < c.size(); i++)
52  {
53  f(i, *c[i], std::forward<Args_>(args)...);
54  }
55  }

◆ executeMemberDereferenced()

template<typename Container , typename Object , typename Method , typename... Args>
static void NumLib::SerialExecutor::executeMemberDereferenced ( Object &  object,
Method  method,
Container const &  container,
Args &&...  args 
)
inlinestatic

Executes the given method of the given object for each element from the input container.

This method is very similar to executeDereferenced().

Parameters
containercollection of objects having pointer semantics.
objectthe object whose method will be called.
methodthe method being called, i.e., a member function pointer to a member function of the class Object.
argsfurther arguments passed on to the method
See also
executeDereferenced()

Definition at line 72 of file SerialExecutor.h.

Referenced by ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::assembleConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), and executeSelectedMemberDereferenced().

75  {
76  for (std::size_t i = 0; i < container.size(); i++)
77  {
78  (object.*method)(i, *container[i], std::forward<Args>(args)...);
79  }
80  }

◆ executeMemberOnDereferenced()

template<typename Container , typename Method , typename... Args>
static void NumLib::SerialExecutor::executeMemberOnDereferenced ( Method  method,
Container const &  container,
Args &&...  args 
)
inlinestatic

Executes the given method on each element of the input container.

This method is very similar to executeMemberDereferenced().

Parameters
containercollection of objects having pointer semantics.
methodthe method being called, i.e., a member function pointer. to a member function of the container's elements.
argsfurther arguments passed on to the method
See also
executeDereferenced()

Definition at line 129 of file SerialExecutor.h.

Referenced by ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::applyNaturalBC(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< LocalAssemblerImplementation >::applyNaturalBC(), ProcessLib::PythonBoundaryCondition::applyNaturalBC(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), executeSelectedMemberOnDereferenced(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::VolumetricSourceTerm::integrate(), ProcessLib::SourceTerms::Python::PythonSourceTerm::integrate(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), and ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess().

132  {
133  for (std::size_t i = 0; i < container.size(); i++)
134  {
135  ((*container[i]).*method)(i, std::forward<Args>(args)...);
136  }
137  }

◆ executeSelectedMemberDereferenced()

template<typename Container , typename Object , typename Method , typename... Args>
static void NumLib::SerialExecutor::executeSelectedMemberDereferenced ( Object &  object,
Method  method,
Container const &  container,
std::vector< std::size_t > const &  active_container_ids,
Args &&...  args 
)
inlinestatic

Executes the given method of the given object for the selected elements from the input container.

This method is very similar to executeDereferenced().

Parameters
objectthe object whose method will be called.
methodthe method being called, i.e., a member function pointer to a member function of the class Object.
containercollection of objects having pointer semantics.
active_container_idsThe IDs of active elements of container.
argsfurther arguments passed on to the method.
See also
executeDereferenced()

Definition at line 99 of file SerialExecutor.h.

References executeMemberDereferenced().

Referenced by ProcessLib::HeatConduction::HeatConductionProcess::assembleConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleConcreteProcess(), ProcessLib::TES::TESProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::GroundwaterFlow::GroundwaterFlowProcess::assembleConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleConcreteProcess(), ProcessLib::HT::HTProcess::assembleConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::assembleConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::assembleConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleWithJacobianConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::TES::TESProcess::assembleWithJacobianConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::GroundwaterFlow::GroundwaterFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HT::HTProcess::assembleWithJacobianConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::assembleWithJacobianConcreteProcess(), and ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::preAssembleConcreteProcess().

102  {
103  if (active_container_ids.empty())
104  {
105  executeMemberDereferenced(object, method, container,
106  std::forward<Args>(args)...);
107  return;
108  }
109 
110  for (std::size_t i = 0; i < active_container_ids.size(); i++)
111  {
112  (object.*method)(i, *container[active_container_ids[i]],
113  std::forward<Args>(args)...);
114  }
115  }
static void executeMemberDereferenced(Object &object, Method method, Container const &container, Args &&... args)

◆ executeSelectedMemberOnDereferenced()

template<typename Container , typename Method , typename... Args>
static void NumLib::SerialExecutor::executeSelectedMemberOnDereferenced ( Method  method,
Container const &  container,
std::vector< std::size_t > const &  active_container_ids,
Args &&...  args 
)
inlinestatic

Executes the given method on the selected elements of the input container.

This method is very similar to executeSelectedMemberDereferenced().

Parameters
methodthe method being called, i.e., a member function pointer to a member function of the container's elements.
containercollection of objects having pointer semantics.
active_container_idsThe IDs of active elements of container.
argsfurther arguments passed on to the method.
See also
executeDereferenced()

Definition at line 154 of file SerialExecutor.h.

References executeMemberOnDereferenced().

Referenced by ProcessLib::HeatConduction::HeatConductionProcess::computeSecondaryVariableConcrete(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::computeSecondaryVariableConcrete(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::LiquidFlow::LiquidFlowProcess::computeSecondaryVariableConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::SurfaceFlux::integrate(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::postIterationConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::preTimestepConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::preTimestepConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::preTimestepConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::HT::HTProcess::setCoupledTermForTheStaggeredSchemeToLocalAssemblers(), and ProcessLib::ComponentTransport::ComponentTransportProcess::setCoupledTermForTheStaggeredSchemeToLocalAssemblers().

157  {
158  if (active_container_ids.empty())
159  {
160  executeMemberOnDereferenced(method, container,
161  std::forward<Args>(args)...);
162  return;
163  }
164 
165  for (std::size_t i = 0; i < active_container_ids.size(); i++)
166  {
167  ((*container[active_container_ids[i]]).*method)(
168  i, std::forward<Args>(args)...);
169  }
170  }
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)

◆ transformDereferenced()

template<typename F , typename C , typename Data , typename... Args_>
static void NumLib::SerialExecutor::transformDereferenced ( F const &  f,
C const &  c,
Data &  data,
Args_ &&...  args 
)
inlinestatic

Same as execute(f, c), but with two containers, where the second one is modified.

Template Parameters
Ff type.
Cinput container type.
Datainput/output container type.
Parameters
fa function that accepts a pointer to container's elements, an index, and a second container element as arguments, which is modified.
ca container supporting const access over operator[] and size(). The elements of c must have pointer semantics, i.e., support dereferencing via unary operator*().
dataa container supporting non-const access over operator[] and size().
argsadditional arguments passed to f

Definition at line 190 of file SerialExecutor.h.

Referenced by ProcessLib::SmallDeformation::detail::createLocalAssemblers(), ProcessLib::detail::createLocalAssemblers(), ProcessLib::HydroMechanics::detail::createLocalAssemblers(), ProcessLib::RichardsMechanics::detail::createLocalAssemblers(), ProcessLib::HeatTransportBHE::detail::createLocalAssemblers(), ProcessLib::ThermoHydroMechanics::detail::createLocalAssemblers(), ProcessLib::LIE::HydroMechanics::detail::createLocalAssemblers(), and ProcessLib::LIE::SmallDeformation::detail::createLocalAssemblers().

192  {
193  assert(c.size() == data.size());
194 
195  for (std::size_t i = 0; i < c.size(); i++)
196  {
197  f(i, *c[i], data[i], std::forward<Args_>(args)...);
198  }
199  }

The documentation for this struct was generated from the following file: