OGS
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 48 of file SerialExecutor.h.

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

References MaterialPropertyLib::c.

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

◆ 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 71 of file SerialExecutor.h.

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

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

◆ 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 127 of file SerialExecutor.h.

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

Referenced by ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::applyNaturalBC(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< GlobalDim, LocalAssemblerImplementation >::applyNaturalBC(), ProcessLib::PythonBoundaryCondition::applyNaturalBC(), executeSelectedMemberOnDereferenced(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), ProcessLib::SourceTerms::Python::PythonSourceTerm::integrate(), ProcessLib::VolumetricSourceTerm::integrate(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), and ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::setInitialConditionsConcreteProcess().

◆ 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 98 of file SerialExecutor.h.

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

References executeMemberDereferenced().

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

◆ 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 152 of file SerialExecutor.h.

155 {
156 if (active_container_ids.empty())
157 {
158 executeMemberOnDereferenced(method, container,
159 std::forward<Args>(args)...);
160 return;
161 }
162
163 for (auto const id : active_container_ids)
164 {
165 ((*container[id]).*method)(id, std::forward<Args>(args)...);
166 }
167 }
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)

References executeMemberOnDereferenced().

Referenced by ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::HeatConduction::HeatConductionProcess::computeSecondaryVariableConcrete(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::computeSecondaryVariableConcrete(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::LiquidFlow::LiquidFlowProcess::computeSecondaryVariableConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ComponentTransport::ComponentTransportProcess::computeSecondaryVariableConcrete(), ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >::computeSecondaryVariableConcrete(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::SurfaceFlux::integrate(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::postIterationConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::postTimestepConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::SmallDeformation::SmallDeformationProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >::postTimestepConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::postTimestepConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::postTimestepConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::preTimestepConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::preTimestepConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::TH2M::TH2MProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::preTimestepConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::preTimestepConcreteProcess(), ProcessLib::HT::HTProcess::setCoupledTermForTheStaggeredSchemeToLocalAssemblers(), ProcessLib::ComponentTransport::ComponentTransportProcess::setInitialConditionsConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), and ProcessLib::ComponentTransport::ComponentTransportProcess::solveReactionEquation().

◆ 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 187 of file SerialExecutor.h.

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

References MaterialPropertyLib::c.

Referenced by ProcessLib::BoundaryConditionAndSourceTerm::detail::createLocalAssemblers(), ProcessLib::LIE::HydroMechanics::detail::createLocalAssemblers(), ProcessLib::LIE::SmallDeformation::detail::createLocalAssemblers(), ProcessLib::SmallDeformation::detail::createLocalAssemblers(), ProcessLib::createLocalAssemblers(), ProcessLib::HeatTransportBHE::detail::createLocalAssemblers(), ProcessLib::BoundaryConditionAndSourceTerm::detail::createLocalAssemblersPython(), and ProcessLib::detail::createLocalAssemblersTaylorHood().


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