OGS
ProcessLib::LocalAssemblerInterface Class Reference

Detailed Description

Common interface for local assemblers NumLib::ODESystemTag::FirstOrderImplicitQuasilinear ODE systems.

Todo:
Generalize to other NumLib::ODESystemTag's.

Definition at line 33 of file LocalAssemblerInterface.h.

#include <LocalAssemblerInterface.h>

Inheritance diagram for ProcessLib::LocalAssemblerInterface:
[legend]

Public Member Functions

virtual ~LocalAssemblerInterface ()=default
 
void setInitialConditions (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, bool const use_monolithic_scheme, int const process_id)
 
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
virtual void preAssemble (double const, double const, std::vector< double > const &)
 
virtual void assemble (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_xdot, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_xdot, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
virtual void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_xdot, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
virtual void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_xdot, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_dot, int const process_id)
 
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
 
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, double const dt)
 
void postNonLinearSolver (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, GlobalVector const &xdot, double const t, double const dt, bool const use_monolithic_scheme, int const process_id)
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double >> const &) const
 Fits to staggered scheme. More...
 

Private Member Functions

virtual void setInitialConditionsConcrete (std::vector< double > const &, double const, bool const, int const)
 
virtual void initializeConcrete ()
 
virtual void preTimestepConcrete (std::vector< double > const &, double const, double const)
 
virtual void postTimestepConcrete (Eigen::VectorXd const &, double const, double const)
 
virtual void postNonLinearSolverConcrete (std::vector< double > const &, std::vector< double > const &, double const, double const, bool const, int const)
 
virtual void computeSecondaryVariableConcrete (double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &)
 
virtual void computeSecondaryVariableWithCoupledProcessConcrete (double const, std::vector< std::vector< double >> const &)
 

Constructor & Destructor Documentation

◆ ~LocalAssemblerInterface()

virtual ProcessLib::LocalAssemblerInterface::~LocalAssemblerInterface ( )
virtualdefault

Member Function Documentation

◆ assemble()

void ProcessLib::LocalAssemblerInterface::assemble ( double const  t,
double const  dt,
std::vector< double > const &  local_x,
std::vector< double > const &  local_xdot,
std::vector< double > &  local_M_data,
std::vector< double > &  local_K_data,
std::vector< double > &  local_b_data 
)
virtual

Reimplemented in ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, DisplacementDim >, ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >, ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerFracture< ShapeFunction, DisplacementDim >, ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface, ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerSoil< ShapeFunction >, ProcessLib::HeatTransportBHE::HeatTransportBHELocalAssemblerBHE< ShapeFunction, BHEType >, ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoLocalAssembler< ShapeFunction, GlobalDim >, ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >, ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPLocalAssembler< ShapeFunction, GlobalDim >, ProcessLib::TES::TESLocalAssembler< ShapeFunction_, GlobalDim >, ProcessLib::RichardsComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >, ProcessLib::RichardsFlow::LocalAssemblerData< ShapeFunction, GlobalDim >, ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >, ProcessLib::HT::MonolithicHTFEM< ShapeFunction, GlobalDim >, ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >, ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >, ProcessLib::StokesFlow::LocalAssemblerData< ShapeFunctionLiquidVelocity, ShapeFunctionPressure, GlobalDim >, and ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >.

Definition at line 21 of file LocalAssemblerInterface.cpp.

29 {
30  OGS_FATAL(
31  "The assemble() function is not implemented in the local assembler.");
32 }
#define OGS_FATAL(...)
Definition: Error.h:26

References OGS_FATAL.

Referenced by ProcessLib::VectorMatrixAssembler::assemble(), ProcessLib::CentralDifferencesJacobianAssembler::assembleWithJacobian(), and ProcessLib::ForwardDifferencesJacobianAssembler::assembleWithJacobian().

◆ assembleForStaggeredScheme()

void ProcessLib::LocalAssemblerInterface::assembleForStaggeredScheme ( double const  t,
double const  dt,
Eigen::VectorXd const &  local_x,
Eigen::VectorXd const &  local_xdot,
int const  process_id,
std::vector< double > &  local_M_data,
std::vector< double > &  local_K_data,
std::vector< double > &  local_b_data 
)
virtual

Reimplemented in ProcessLib::HT::StaggeredHTFEM< ShapeFunction, GlobalDim >, and ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >.

Definition at line 34 of file LocalAssemblerInterface.cpp.

40 {
41  OGS_FATAL(
42  "The assembleForStaggeredScheme() function is not implemented in the "
43  "local assembler.");
44 }

References OGS_FATAL.

Referenced by ProcessLib::VectorMatrixAssembler::assemble().

◆ assembleWithJacobian()

void ProcessLib::LocalAssemblerInterface::assembleWithJacobian ( double const  t,
double const  dt,
std::vector< double > const &  local_x,
std::vector< double > const &  local_xdot,
std::vector< double > &  local_M_data,
std::vector< double > &  local_K_data,
std::vector< double > &  local_b_data,
std::vector< double > &  local_Jac_data 
)
virtual

Reimplemented in ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface, ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerInterface, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >, ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, DisplacementDim >, ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowLocalAssembler< ShapeFunction, GlobalDim >, ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >, ProcessLib::HeatConduction::LocalAssemblerData< ShapeFunction, GlobalDim >, ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, DisplacementDim >, and ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, DisplacementDim >.

Definition at line 46 of file LocalAssemblerInterface.cpp.

54 {
55  OGS_FATAL(
56  "The assembleWithJacobian() function is not implemented in the local "
57  "assembler.");
58 }

References OGS_FATAL.

Referenced by ProcessLib::AnalyticalJacobianAssembler::assembleWithJacobian().

◆ assembleWithJacobianForStaggeredScheme()

void ProcessLib::LocalAssemblerInterface::assembleWithJacobianForStaggeredScheme ( double const  t,
double const  dt,
Eigen::VectorXd const &  local_x,
Eigen::VectorXd const &  local_xdot,
int const  process_id,
std::vector< double > &  local_M_data,
std::vector< double > &  local_K_data,
std::vector< double > &  local_b_data,
std::vector< double > &  local_Jac_data 
)
virtual

◆ computeSecondaryVariable()

void ProcessLib::LocalAssemblerInterface::computeSecondaryVariable ( std::size_t const  mesh_item_id,
std::vector< NumLib::LocalToGlobalIndexMap const * > const &  dof_tables,
double const  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
GlobalVector const &  x_dot,
int const  process_id 
)
virtual

Definition at line 73 of file LocalAssemblerInterface.cpp.

78 {
79  std::vector<double> local_x_vec;
80 
81  auto const n_processes = x.size();
82  for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
83  {
84  auto const indices =
85  NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
86  assert(!indices.empty());
87  auto const local_solution = x[process_id]->get(indices);
88  local_x_vec.insert(std::end(local_x_vec), std::begin(local_solution),
89  std::end(local_solution));
90  }
91  auto const local_x = MathLib::toVector(local_x_vec);
92 
93  // Todo: A more decent way is to directly pass x_dots as done for x
94  auto const indices =
95  NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
96  auto const local_x_dot_vec = x_dot.get(indices);
97  auto const local_x_dot = MathLib::toVector(local_x_dot_vec);
98 
99  computeSecondaryVariableConcrete(t, dt, local_x, local_x_dot);
100 }
virtual void computeSecondaryVariableConcrete(double const, double const, Eigen::VectorXd const &, Eigen::VectorXd const &)
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
static const double t
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)

References computeSecondaryVariableConcrete(), MathLib::EigenVector::get(), NumLib::getIndices(), MathLib::t, and MathLib::toVector().

Referenced by 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::ThermoRichardsFlow::ThermoRichardsFlowProcess::computeSecondaryVariableConcrete(), ProcessLib::ComponentTransport::ComponentTransportProcess::computeSecondaryVariableConcrete(), and ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >::computeSecondaryVariableConcrete().

◆ computeSecondaryVariableConcrete()

◆ computeSecondaryVariableWithCoupledProcessConcrete()

virtual void ProcessLib::LocalAssemblerInterface::computeSecondaryVariableWithCoupledProcessConcrete ( double const  ,
std::vector< std::vector< double >> const &   
)
inlineprivatevirtual

Definition at line 157 of file LocalAssemblerInterface.h.

160  {
161  }

◆ getFlux() [1/2]

virtual Eigen::Vector3d ProcessLib::LocalAssemblerInterface::getFlux ( MathLib::Point3d const &  ,
double const  ,
std::vector< double > const &   
) const
inlinevirtual

Computes the flux in the point p_local_coords that is given in local coordinates using the values from local_x. Fits to monolithic scheme.

Reimplemented in ProcessLib::HT::HTLocalAssemblerInterface, ProcessLib::HT::HTFEM< ShapeFunction, GlobalDim >, ProcessLib::ComponentTransport::LocalAssemblerData< ShapeFunction, GlobalDim >, ProcessLib::SteadyStateDiffusion::LocalAssemblerData< ShapeFunction, GlobalDim >, and ProcessLib::LiquidFlow::LiquidFlowLocalAssembler< ShapeFunction, GlobalDim >.

Definition at line 105 of file LocalAssemblerInterface.h.

109  {
110  return Eigen::Vector3d{};
111  }

◆ getFlux() [2/2]

virtual Eigen::Vector3d ProcessLib::LocalAssemblerInterface::getFlux ( MathLib::Point3d const &  ,
double const  ,
std::vector< std::vector< double >> const &   
) const
inlinevirtual

Fits to staggered scheme.

Definition at line 114 of file LocalAssemblerInterface.h.

118  {
119  return Eigen::Vector3d{};
120  }

◆ initialize()

◆ initializeConcrete()

◆ postNonLinearSolver()

void ProcessLib::LocalAssemblerInterface::postNonLinearSolver ( std::size_t const  mesh_item_id,
NumLib::LocalToGlobalIndexMap const &  dof_table,
GlobalVector const &  x,
GlobalVector const &  xdot,
double const  t,
double const  dt,
bool const  use_monolithic_scheme,
int const  process_id 
)

Definition at line 153 of file LocalAssemblerInterface.cpp.

158 {
159  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
160  auto const local_x = x.get(indices);
161  auto const local_xdot = xdot.get(indices);
162 
163  postNonLinearSolverConcrete(local_x, local_xdot, t, dt,
164  use_monolithic_scheme, process_id);
165 }
virtual void postNonLinearSolverConcrete(std::vector< double > const &, std::vector< double > const &, double const, double const, bool const, int const)

References MathLib::EigenVector::get(), NumLib::getIndices(), postNonLinearSolverConcrete(), and MathLib::t.

Referenced by ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::postNonLinearSolverConcreteProcess(), and ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postNonLinearSolverConcreteProcess().

◆ postNonLinearSolverConcrete()

virtual void ProcessLib::LocalAssemblerInterface::postNonLinearSolverConcrete ( std::vector< double > const &  ,
std::vector< double > const &  ,
double const  ,
double const  ,
bool const  ,
int const   
)
inlineprivatevirtual

◆ postTimestep()

void ProcessLib::LocalAssemblerInterface::postTimestep ( std::size_t const  mesh_item_id,
std::vector< NumLib::LocalToGlobalIndexMap const * > const &  dof_tables,
std::vector< GlobalVector * > const &  x,
double const  t,
double const  dt 
)
virtual

Definition at line 131 of file LocalAssemblerInterface.cpp.

135 {
136  std::vector<double> local_x_vec;
137 
138  auto const n_processes = x.size();
139  for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
140  {
141  auto const indices =
142  NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
143  assert(!indices.empty());
144  auto const local_solution = x[process_id]->get(indices);
145  local_x_vec.insert(std::end(local_x_vec), std::begin(local_solution),
146  std::end(local_solution));
147  }
148  auto const local_x = MathLib::toVector(local_x_vec);
149 
150  postTimestepConcrete(local_x, t, dt);
151 }
virtual void postTimestepConcrete(Eigen::VectorXd const &, double const, double const)

References NumLib::getIndices(), postTimestepConcrete(), MathLib::t, and MathLib::toVector().

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::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::ThermoRichardsFlow::ThermoRichardsFlowProcess::postTimestepConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::postTimestepConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::postTimestepConcreteProcess(), and ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess().

◆ postTimestepConcrete()

virtual void ProcessLib::LocalAssemblerInterface::postTimestepConcrete ( Eigen::VectorXd const &  ,
double const  ,
double const   
)
inlineprivatevirtual

◆ preAssemble()

virtual void ProcessLib::LocalAssemblerInterface::preAssemble ( double const  ,
double const  ,
std::vector< double > const &   
)
inlinevirtual

◆ preTimestep()

void ProcessLib::LocalAssemblerInterface::preTimestep ( std::size_t const  mesh_item_id,
NumLib::LocalToGlobalIndexMap const &  dof_table,
GlobalVector const &  x,
double const  t,
double const  delta_t 
)
virtual

◆ preTimestepConcrete()

◆ setInitialConditions()

void ProcessLib::LocalAssemblerInterface::setInitialConditions ( std::size_t const  mesh_item_id,
NumLib::LocalToGlobalIndexMap const &  dof_table,
GlobalVector const &  x,
double const  t,
bool const  use_monolithic_scheme,
int const  process_id 
)

Definition at line 102 of file LocalAssemblerInterface.cpp.

106 {
107  auto const indices = NumLib::getIndices(mesh_item_id, dof_table);
108  auto const local_x = x.get(indices);
109 
110  setInitialConditionsConcrete(local_x, t, use_monolithic_scheme, process_id);
111 }
virtual void setInitialConditionsConcrete(std::vector< double > const &, double const, bool const, int const)

References MathLib::EigenVector::get(), NumLib::getIndices(), setInitialConditionsConcrete(), and MathLib::t.

Referenced by ProcessLib::TH2M::TH2MProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), and ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::setInitialConditionsConcreteProcess().

◆ setInitialConditionsConcrete()


The documentation for this class was generated from the following files: