OGS
ProcessLib::Process Class Referenceabstract

Detailed Description

Definition at line 38 of file Process.h.

#include <Process.h>

Inheritance diagram for ProcessLib::Process:
[legend]
Collaboration diagram for ProcessLib::Process:
[legend]

Public Types

using NonlinearSolver = NumLib::NonlinearSolverBase
 
using TimeDiscretization = NumLib::TimeDiscretization
 

Public Member Functions

 Process (std::string name_, MeshLib::Mesh &mesh, std::unique_ptr< AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&process_variables, SecondaryVariableCollection &&secondary_variables, const bool use_monolithic_scheme=true)
 
void preTimestep (std::vector< GlobalVector * > const &x, const double t, const double delta_t, const int process_id)
 Preprocessing before starting assembly for new timestep. More...
 
void postTimestep (std::vector< GlobalVector * > const &x, const double t, const double delta_t, int const process_id)
 Postprocessing after a complete timestep. More...
 
void postNonLinearSolver (GlobalVector const &x, GlobalVector const &xdot, const double t, double const dt, int const process_id)
 
void preIteration (const unsigned iter, GlobalVector const &x) final
 
void computeSecondaryVariable (double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_dot, int const process_id)
 compute secondary variables for the coupled equations or for output. More...
 
NumLib::IterationResult postIteration (GlobalVector const &x) final
 
void initialize ()
 
void setInitialConditions (std::vector< GlobalVector * > &process_solutions, std::vector< GlobalVector * > const &process_solutions_prev, double const t, int const process_id)
 
MathLib::MatrixSpecifications getMatrixSpecifications (const int process_id) const override
 
void setCoupledSolutionsForStaggeredScheme (CoupledSolutionsForStaggeredScheme *const coupled_solutions)
 
void updateDeactivatedSubdomains (double const time, const int process_id)
 
bool isMonolithicSchemeUsed () const
 
virtual void setCoupledTermForTheStaggeredSchemeToLocalAssemblers (int const)
 
virtual void extrapolateIntegrationPointValuesToNodes (const double, std::vector< GlobalVector * > const &, std::vector< GlobalVector * > &)
 
void preAssemble (const double t, double const dt, GlobalVector const &x) final
 
void assemble (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) final
 
void assembleWithJacobian (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac) final
 
std::vector< NumLib::IndexValueVector< GlobalIndexType > > const * getKnownSolutions (double const t, GlobalVector const &x, int const process_id) const final
 
virtual NumLib::LocalToGlobalIndexMap const & getDOFTable (const int) const
 
MeshLib::MeshgetMesh () const
 
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables (const int process_id) const
 
SecondaryVariableCollection const & getSecondaryVariables () const
 
std::vector< std::unique_ptr< IntegrationPointWriter > > const & getIntegrationPointWriters () const
 
virtual Eigen::Vector3d getFlux (std::size_t, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &) const
 
virtual void solveReactionEquation (std::vector< GlobalVector * > &, std::vector< GlobalVector * > const &, double const, double const, NumLib::EquationSystem &, int const)
 

Public Attributes

std::string const name
 

Protected Member Functions

NumLib::ExtrapolatorgetExtrapolator () const
 
NumLib::LocalToGlobalIndexMap const & getSingleComponentDOFTable () const
 
void initializeProcessBoundaryConditionsAndSourceTerms (const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id)
 
virtual void constructDofTable ()
 
void constructMonolithicProcessDofTable ()
 
void constructDofTableOfSpecifiedProcessStaggeredScheme (const int specified_prosess_id)
 
virtual std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData () const
 

Protected Attributes

MeshLib::Mesh_mesh
 
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_local_to_global_index_map
 
SecondaryVariableCollection _secondary_variables
 
VectorMatrixAssembler _global_assembler
 
const bool _use_monolithic_scheme
 
CoupledSolutionsForStaggeredScheme_coupled_solutions
 
unsigned const _integration_order
 
std::vector< std::unique_ptr< IntegrationPointWriter > > _integration_point_writer
 
GlobalSparsityPattern _sparsity_pattern
 
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > _process_variables
 
std::vector< BoundaryConditionCollection_boundary_conditions
 

Private Member Functions

virtual void initializeConcreteProcess (NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order)=0
 Process specific initialization called by initialize(). More...
 
virtual void initializeBoundaryConditions ()
 
virtual void setInitialConditionsConcreteProcess (std::vector< GlobalVector * > &, double const, int const)
 
virtual void preAssembleConcreteProcess (const double, double const, GlobalVector const &)
 
virtual void assembleConcreteProcess (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)=0
 
virtual void assembleWithJacobianConcreteProcess (const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)=0
 
virtual void preTimestepConcreteProcess (std::vector< GlobalVector * > const &, const double, const double, const int)
 
virtual void postTimestepConcreteProcess (std::vector< GlobalVector * > const &, const double, const double, int const)
 
virtual void postNonLinearSolverConcreteProcess (GlobalVector const &, GlobalVector const &, const double, double const, int const)
 
virtual void preIterationConcreteProcess (const unsigned, GlobalVector const &)
 
virtual void computeSecondaryVariableConcrete (double const, double const, std::vector< GlobalVector * > const &, GlobalVector const &, int const)
 
virtual NumLib::IterationResult postIterationConcreteProcess (GlobalVector const &)
 
void initializeExtrapolator ()
 
void computeSparsityPattern ()
 

Private Attributes

std::vector< SourceTermCollection_source_term_collections
 
ExtrapolatorData _extrapolator_data
 

Member Typedef Documentation

◆ NonlinearSolver

◆ TimeDiscretization

Constructor & Destructor Documentation

◆ Process()

ProcessLib::Process::Process ( std::string  name_,
MeshLib::Mesh mesh,
std::unique_ptr< AbstractJacobianAssembler > &&  jacobian_assembler,
std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &  parameters,
unsigned const  integration_order,
std::vector< std::vector< std::reference_wrapper< ProcessVariable >>> &&  process_variables,
SecondaryVariableCollection &&  secondary_variables,
const bool  use_monolithic_scheme = true 
)

Definition at line 22 of file Process.cpp.

32  : name(std::move(name_)),
33  _mesh(mesh),
34  _secondary_variables(std::move(secondary_variables)),
35  _global_assembler(std::move(jacobian_assembler)),
36  _use_monolithic_scheme(use_monolithic_scheme),
37  _coupled_solutions(nullptr),
38  _integration_order(integration_order),
39  _process_variables(std::move(process_variables)),
41  [&](const std::size_t number_of_process_variables)
42  -> std::vector<BoundaryConditionCollection>
43  {
44  std::vector<BoundaryConditionCollection> pcs_BCs;
45  pcs_BCs.reserve(number_of_process_variables);
46  for (std::size_t i = 0; i < number_of_process_variables; i++)
47  {
48  pcs_BCs.emplace_back(BoundaryConditionCollection(parameters));
49  }
50  return pcs_BCs;
51  }(_process_variables.size())),
53  [&](const std::size_t number_of_processes)
54  -> std::vector<SourceTermCollection>
55  {
56  std::vector<SourceTermCollection> pcs_sts;
57  pcs_sts.reserve(number_of_processes);
58  for (std::size_t i = 0; i < number_of_processes; i++)
59  {
60  pcs_sts.emplace_back(SourceTermCollection(parameters));
61  }
62  return pcs_sts;
63  }(_process_variables.size()))
64 {
65 }
std::string const name
Definition: Process.h:318
std::vector< BoundaryConditionCollection > _boundary_conditions
Definition: Process.h:360
MeshLib::Mesh & _mesh
Definition: Process.h:321
std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > _process_variables
Definition: Process.h:355
SecondaryVariableCollection _secondary_variables
Definition: Process.h:326
CoupledSolutionsForStaggeredScheme * _coupled_solutions
Definition: Process.h:334
VectorMatrixAssembler _global_assembler
Definition: Process.h:328
unsigned const _integration_order
Definition: Process.h:339
std::vector< SourceTermCollection > _source_term_collections
Definition: Process.h:366
const bool _use_monolithic_scheme
Definition: Process.h:330

Member Function Documentation

◆ assemble()

void ProcessLib::Process::assemble ( const double  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  xdot,
int const  process_id,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b 
)
final

Definition at line 206 of file Process.cpp.

211 {
212  assert(x.size() == xdot.size());
213  for (std::size_t i = 0; i < x.size(); i++)
214  {
217  }
218 
219  assembleConcreteProcess(t, dt, x, xdot, process_id, M, K, b);
220 
221  // the last argument is for the jacobian, nullptr is for a unused jacobian
222  _boundary_conditions[process_id].applyNaturalBC(t, x, process_id, K, b,
223  nullptr);
224 
225  // the last argument is for the jacobian, nullptr is for a unused jacobian
226  _source_term_collections[process_id].integrate(t, *x[process_id], b,
227  nullptr);
228 }
virtual void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b)=0
void setLocalAccessibleVector(PETScVector const &x)
Definition: LinAlg.cpp:27
static const double t

References _boundary_conditions, _source_term_collections, assembleConcreteProcess(), MathLib::LinAlg::setLocalAccessibleVector(), and MathLib::t.

◆ assembleConcreteProcess()

virtual void ProcessLib::Process::assembleConcreteProcess ( const double  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  xdot,
int const  process_id,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b 
)
privatepure virtual

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

Referenced by assemble().

◆ assembleWithJacobian()

void ProcessLib::Process::assembleWithJacobian ( const double  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  xdot,
int const  process_id,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b,
GlobalMatrix Jac 
)
final

Definition at line 230 of file Process.cpp.

236 {
237  assert(x.size() == xdot.size());
238  for (std::size_t i = 0; i < x.size(); i++)
239  {
242  }
243 
244  assembleWithJacobianConcreteProcess(t, dt, x, xdot, process_id, M, K, b,
245  Jac);
246 
247  // TODO: apply BCs to Jacobian.
248  _boundary_conditions[process_id].applyNaturalBC(t, x, process_id, K, b,
249  &Jac);
250 
251  // the last argument is for the jacobian, nullptr is for a unused jacobian
252  _source_term_collections[process_id].integrate(t, *x[process_id], b, &Jac);
253 }
virtual void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &xdot, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b, GlobalMatrix &Jac)=0

References _boundary_conditions, _source_term_collections, assembleWithJacobianConcreteProcess(), MathLib::LinAlg::setLocalAccessibleVector(), and MathLib::t.

◆ assembleWithJacobianConcreteProcess()

virtual void ProcessLib::Process::assembleWithJacobianConcreteProcess ( const double  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
std::vector< GlobalVector * > const &  xdot,
int const  process_id,
GlobalMatrix M,
GlobalMatrix K,
GlobalVector b,
GlobalMatrix Jac 
)
privatepure virtual

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

Referenced by assembleWithJacobian().

◆ computeSecondaryVariable()

void ProcessLib::Process::computeSecondaryVariable ( double const  t,
double const  dt,
std::vector< GlobalVector * > const &  x,
GlobalVector const &  x_dot,
int const  process_id 
)

compute secondary variables for the coupled equations or for output.

Definition at line 410 of file Process.cpp.

415 {
416  for (auto const* solution : x)
419 
420  computeSecondaryVariableConcrete(t, dt, x, x_dot, process_id);
421 }
virtual void computeSecondaryVariableConcrete(double const, double const, std::vector< GlobalVector * > const &, GlobalVector const &, int const)
Definition: Process.h:261

References computeSecondaryVariableConcrete(), MathLib::LinAlg::setLocalAccessibleVector(), and MathLib::t.

◆ computeSecondaryVariableConcrete()

◆ computeSparsityPattern()

void ProcessLib::Process::computeSparsityPattern ( )
private

Computes and stores global matrix' sparsity pattern from given DOF-table.

Definition at line 375 of file Process.cpp.

376 {
379 }
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _local_to_global_index_map
Definition: Process.h:324
GlobalSparsityPattern _sparsity_pattern
Definition: Process.h:347
GlobalSparsityPattern computeSparsityPattern(LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
Computes a sparsity pattern for the given inputs.

References _local_to_global_index_map, _mesh, _sparsity_pattern, and NumLib::computeSparsityPattern().

Referenced by initialize().

◆ constructDofTable()

void ProcessLib::Process::constructDofTable ( )
protectedvirtual

This function is for general cases, in which all equations of the coupled processes have the same number of unknowns. For the general cases with the staggered scheme, all equations of the coupled processes share one DOF table hold by _local_to_global_index_map. Other cases can be considered by overloading this member function in the derived class.

Reimplemented in ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >, ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >, ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >, ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >, ProcessLib::TH2M::TH2MProcess< DisplacementDim >, ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >, ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >, ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >, ProcessLib::LIE::SmallDeformation::SmallDeformationProcess< DisplacementDim >, ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >, ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >, and ProcessLib::HeatTransportBHE::HeatTransportBHEProcess.

Definition at line 255 of file Process.cpp.

256 {
258  {
260 
261  return;
262  }
263 
264  // For staggered scheme:
265  const int specified_process_id = 0;
267 }
void constructDofTableOfSpecifiedProcessStaggeredScheme(const int specified_prosess_id)
Definition: Process.cpp:302
void constructMonolithicProcessDofTable()
Definition: Process.cpp:269

References _use_monolithic_scheme, constructDofTableOfSpecifiedProcessStaggeredScheme(), and constructMonolithicProcessDofTable().

Referenced by initialize().

◆ constructDofTableOfSpecifiedProcessStaggeredScheme()

void ProcessLib::Process::constructDofTableOfSpecifiedProcessStaggeredScheme ( const int  specified_prosess_id)
protected

Construct the DOF table for a specified process in the staggered scheme, which is stored in the member of this class, _local_to_global_index_map.

Definition at line 302 of file Process.cpp.

304 {
305  // Create single component dof in every of the mesh nodes.
307  std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
308 
309  // Vector of mesh subsets.
310  std::vector<MeshLib::MeshSubset> all_mesh_subsets;
311 
312  // Vector of the number of variable components
313  std::vector<int> vec_var_n_components;
314  // Collect the mesh subsets in a vector for each variables' components.
315  std::generate_n(std::back_inserter(all_mesh_subsets),
316  _process_variables[specified_process_id][0]
317  .get()
318  .getNumberOfGlobalComponents(),
319  [&]() { return *_mesh_subset_all_nodes; });
320 
321  // Create a vector of the number of variable components.
322  vec_var_n_components.push_back(_process_variables[specified_process_id][0]
323  .get()
324  .getNumberOfGlobalComponents());
326  std::make_unique<NumLib::LocalToGlobalIndexMap>(
327  std::move(all_mesh_subsets), vec_var_n_components,
329 
331 }
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition: Mesh.h:95
std::unique_ptr< MeshLib::MeshSubset const > _mesh_subset_all_nodes
Definition: Process.h:322
@ BY_LOCATION
Ordering data by spatial location.

References _local_to_global_index_map, _mesh, _mesh_subset_all_nodes, _process_variables, NumLib::BY_LOCATION, and MeshLib::Mesh::getNodes().

Referenced by constructDofTable().

◆ constructMonolithicProcessDofTable()

void ProcessLib::Process::constructMonolithicProcessDofTable ( )
protected

Construct the DOF table for the monolithic scheme, which is stored in the member of this class, _local_to_global_index_map.

Definition at line 269 of file Process.cpp.

270 {
271  // Create single component dof in every of the mesh nodes.
273  std::make_unique<MeshLib::MeshSubset>(_mesh, _mesh.getNodes());
274 
275  // Vector of mesh subsets.
276  std::vector<MeshLib::MeshSubset> all_mesh_subsets;
277 
278  // Collect the mesh subsets in a vector for the components of each
279  // variables.
280  for (ProcessVariable const& pv : _process_variables[0])
281  {
282  std::generate_n(std::back_inserter(all_mesh_subsets),
283  pv.getNumberOfGlobalComponents(),
284  [&]() { return *_mesh_subset_all_nodes; });
285  }
286 
287  // Create a vector of the number of variable components
288  std::vector<int> vec_var_n_components;
289  transform(cbegin(_process_variables[0]), cend(_process_variables[0]),
290  back_inserter(vec_var_n_components),
291  [](ProcessVariable const& pv)
292  { return pv.getNumberOfGlobalComponents(); });
293 
295  std::make_unique<NumLib::LocalToGlobalIndexMap>(
296  std::move(all_mesh_subsets), vec_var_n_components,
298 
300 }

References _local_to_global_index_map, _mesh, _mesh_subset_all_nodes, _process_variables, NumLib::BY_LOCATION, MeshLib::Mesh::getNodes(), and ProcessLib::ProcessVariable::getNumberOfGlobalComponents().

Referenced by constructDofTable().

◆ extrapolateIntegrationPointValuesToNodes()

virtual void ProcessLib::Process::extrapolateIntegrationPointValuesToNodes ( const double  ,
std::vector< GlobalVector * > const &  ,
std::vector< GlobalVector * > &   
)
inlinevirtual

Reimplemented in ProcessLib::ComponentTransport::ComponentTransportProcess.

Definition at line 108 of file Process.h.

112  {
113  }

◆ getDOFTable()

◆ getDOFTableForExtrapolatorData()

std::tuple< NumLib::LocalToGlobalIndexMap *, bool > ProcessLib::Process::getDOFTableForExtrapolatorData ( ) const
protectedvirtual

Get the address of a LocalToGlobalIndexMap, and the status of its memory. If the LocalToGlobalIndexMap is created as new in this function, the function also returns a true boolean value to let Extrapolator manage the memory by the address returned by this function.

Returns
Address of a LocalToGlobalIndexMap and its memory status.

Reimplemented in ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >, ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >, ProcessLib::TH2M::TH2MProcess< DisplacementDim >, ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >, ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >, and ProcessLib::HT::HTProcess.

Definition at line 334 of file Process.cpp.

335 {
336  if (_local_to_global_index_map->getNumberOfGlobalComponents() == 1)
337  {
338  // For single-variable-single-component processes reuse the existing DOF
339  // table.
340  const bool manage_storage = false;
341  return std::make_tuple(_local_to_global_index_map.get(),
342  manage_storage);
343  }
344 
345  // Otherwise construct a new DOF table.
346  std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component;
347  all_mesh_subsets_single_component.emplace_back(*_mesh_subset_all_nodes);
348 
349  const bool manage_storage = true;
350 
351  return std::make_tuple(new NumLib::LocalToGlobalIndexMap(
352  std::move(all_mesh_subsets_single_component),
353  // by location order is needed for output
355  manage_storage);
356 }

References _local_to_global_index_map, _mesh_subset_all_nodes, and NumLib::BY_LOCATION.

Referenced by initializeExtrapolator().

◆ getExtrapolator()

NumLib::Extrapolator& ProcessLib::Process::getExtrapolator ( ) const
inlineprotected

Definition at line 180 of file Process.h.

181  {
183  }
NumLib::Extrapolator & getExtrapolator() const
ExtrapolatorData _extrapolator_data
Definition: Process.h:368

References _extrapolator_data, and ProcessLib::ExtrapolatorData::getExtrapolator().

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::extrapolateIntegrationPointValuesToNodes(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::initializeConcreteProcess(), ProcessLib::HT::HTProcess::initializeConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::initializeConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::initializeConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::initializeConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::initializeConcreteProcess(), and ProcessLib::TES::TESProcess::initializeSecondaryVariables().

◆ getFlux()

virtual Eigen::Vector3d ProcessLib::Process::getFlux ( std::size_t  ,
MathLib::Point3d const &  ,
double const  ,
std::vector< GlobalVector * > const &   
) const
inlinevirtual

◆ getIntegrationPointWriters()

std::vector<std::unique_ptr<IntegrationPointWriter> > const& ProcessLib::Process::getIntegrationPointWriters ( ) const
inline

Definition at line 155 of file Process.h.

156  {
158  }
std::vector< std::unique_ptr< IntegrationPointWriter > > _integration_point_writer
Definition: Process.h:345

References _integration_point_writer.

Referenced by anonymous_namespace{ProcessOutputData.cpp}::getIntegrationPointWriters().

◆ getKnownSolutions()

std::vector<NumLib::IndexValueVector<GlobalIndexType> > const* ProcessLib::Process::getKnownSolutions ( double const  t,
GlobalVector const &  x,
int const  process_id 
) const
inlinefinal

Definition at line 130 of file Process.h.

132  {
133  return _boundary_conditions[process_id].getKnownSolutions(t, x);
134  }

References _boundary_conditions, and MathLib::t.

◆ getMatrixSpecifications()

MathLib::MatrixSpecifications ProcessLib::Process::getMatrixSpecifications ( const int  process_id) const
override

Definition at line 182 of file Process.cpp.

184 {
185  auto const& l = *_local_to_global_index_map;
186  return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
187  &l.getGhostIndices(), &_sparsity_pattern};
188 }

References _local_to_global_index_map, and _sparsity_pattern.

◆ getMesh()

◆ getProcessVariables()

std::vector<std::reference_wrapper<ProcessVariable> > const& ProcessLib::Process::getProcessVariables ( const int  process_id) const
inline

Definition at line 144 of file Process.h.

145  {
146  return _process_variables[process_id];
147  }

References _process_variables.

Referenced by ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::HydroMechanicsProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::assembleConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleConcreteProcess(), ProcessLib::HT::HTProcess::assembleConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleConcreteProcess(), ProcessLib::TES::TESProcess::assembleConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HT::HTProcess::assembleWithJacobianConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleWithJacobianConcreteProcess(), ProcessLib::TES::TESProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::computeSecondaryVariableConcrete(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::computeSecondaryVariableConcrete(), ProcessLib::LiquidFlow::LiquidFlowProcess::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::computeSecondaryVariableConcrete(), ProcessLib::ComponentTransport::ComponentTransportProcess::computeSecondaryVariableConcrete(), ProcessLib::createConstraintDirichletBoundaryCondition(), anonymous_namespace{ProcessOutputData.cpp}::getProcessVariablesOfAllProcesses(), ProcessLib::ComponentTransport::ComponentTransportProcess::initializeConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::initializeConcreteProcess(), ProcessLib::HT::HTProcess::postTimestepConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::postTimestepConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::postTimestepConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::postTimestepConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::postTimestepConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::preTimestepConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::preTimestepConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::setCoupledTermForTheStaggeredSchemeToLocalAssemblers(), ProcessLib::HT::HTProcess::setCoupledTermForTheStaggeredSchemeToLocalAssemblers(), ProcessLib::ComponentTransport::ComponentTransportProcess::setInitialConditionsConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::solveReactionEquation(), and updateDeactivatedSubdomains().

◆ getSecondaryVariables()

SecondaryVariableCollection const& ProcessLib::Process::getSecondaryVariables ( ) const
inline

Definition at line 149 of file Process.h.

150  {
151  return _secondary_variables;
152  }

References _secondary_variables.

Referenced by ProcessLib::createProcessOutputData().

◆ getSingleComponentDOFTable()

NumLib::LocalToGlobalIndexMap const& ProcessLib::Process::getSingleComponentDOFTable ( ) const
inlineprotected

◆ initialize()

void ProcessLib::Process::initialize ( )

Definition at line 94 of file Process.cpp.

95 {
96  DBUG("Initialize process.");
97 
98  DBUG("Construct dof mappings.");
100 
101  DBUG("Compute sparsity pattern");
103 
104  DBUG("Initialize the extrapolator");
106 
109 
110  DBUG("Initialize boundary conditions.");
112 }
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
virtual void initializeBoundaryConditions()
Definition: Process.cpp:81
virtual void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order)=0
Process specific initialization called by initialize().
void initializeExtrapolator()
Definition: Process.cpp:358
virtual void constructDofTable()
Definition: Process.cpp:255
void computeSparsityPattern()
Definition: Process.cpp:375

References _integration_order, _local_to_global_index_map, _mesh, computeSparsityPattern(), constructDofTable(), DBUG(), initializeBoundaryConditions(), initializeConcreteProcess(), and initializeExtrapolator().

◆ initializeBoundaryConditions()

void ProcessLib::Process::initializeBoundaryConditions ( )
privatevirtual

Member function to initialize the boundary conditions for all coupled processes. It is called by initialize().

Reimplemented in ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim >, ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >, ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >, ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >, ProcessLib::TH2M::TH2MProcess< DisplacementDim >, ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >, ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >, ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >, and ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >.

Definition at line 81 of file Process.cpp.

82 {
83  // The number of processes is identical to the size of _process_variables,
84  // the vector contains variables for different processes. See the
85  // documentation of _process_variables.
86  const std::size_t number_of_processes = _process_variables.size();
87  for (std::size_t pcs_id = 0; pcs_id < number_of_processes; pcs_id++)
88  {
91  }
92 }
void initializeProcessBoundaryConditionsAndSourceTerms(const NumLib::LocalToGlobalIndexMap &dof_table, const int process_id)
Definition: Process.cpp:67

References _local_to_global_index_map, _process_variables, and initializeProcessBoundaryConditionsAndSourceTerms().

Referenced by initialize().

◆ initializeConcreteProcess()

virtual void ProcessLib::Process::initializeConcreteProcess ( NumLib::LocalToGlobalIndexMap const &  dof_table,
MeshLib::Mesh const &  mesh,
unsigned const  integration_order 
)
privatepure virtual

Process specific initialization called by initialize().

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

Referenced by initialize().

◆ initializeExtrapolator()

void ProcessLib::Process::initializeExtrapolator ( )
private

Definition at line 358 of file Process.cpp.

359 {
360  NumLib::LocalToGlobalIndexMap* dof_table_single_component;
361  bool manage_storage;
362 
363  std::tie(dof_table_single_component, manage_storage) =
365 
366  std::unique_ptr<NumLib::Extrapolator> extrapolator(
368  *dof_table_single_component));
369 
370  // TODO: Later on the DOF table can change during the simulation!
371  _extrapolator_data = ExtrapolatorData(
372  std::move(extrapolator), dof_table_single_component, manage_storage);
373 }
virtual std::tuple< NumLib::LocalToGlobalIndexMap *, bool > getDOFTableForExtrapolatorData() const
Definition: Process.cpp:334

References _extrapolator_data, and getDOFTableForExtrapolatorData().

Referenced by initialize().

◆ initializeProcessBoundaryConditionsAndSourceTerms()

void ProcessLib::Process::initializeProcessBoundaryConditionsAndSourceTerms ( const NumLib::LocalToGlobalIndexMap dof_table,
const int  process_id 
)
protected

Initialize the boundary conditions for a single process or coupled processes modelled by the monolithic scheme. It is called by initializeBoundaryConditions().

Definition at line 67 of file Process.cpp.

69 {
70  auto const& per_process_variables = _process_variables[process_id];
71  auto& per_process_BCs = _boundary_conditions[process_id];
72 
73  per_process_BCs.addBCsForProcessVariables(per_process_variables, dof_table,
74  _integration_order, *this);
75 
76  auto& per_process_sts = _source_term_collections[process_id];
77  per_process_sts.addSourceTermsForProcessVariables(
78  per_process_variables, dof_table, _integration_order);
79 }

References _boundary_conditions, _integration_order, _process_variables, and _source_term_collections.

Referenced by initializeBoundaryConditions().

◆ isMonolithicSchemeUsed()

bool ProcessLib::Process::isMonolithicSchemeUsed ( ) const
inline

◆ postIteration()

NumLib::IterationResult ProcessLib::Process::postIteration ( GlobalVector const &  x)
final

Definition at line 429 of file Process.cpp.

430 {
433 }
virtual NumLib::IterationResult postIterationConcreteProcess(GlobalVector const &)
Definition: Process.h:270

References postIterationConcreteProcess(), and MathLib::LinAlg::setLocalAccessibleVector().

◆ postIterationConcreteProcess()

virtual NumLib::IterationResult ProcessLib::Process::postIterationConcreteProcess ( GlobalVector const &  )
inlineprivatevirtual

◆ postNonLinearSolver()

void ProcessLib::Process::postNonLinearSolver ( GlobalVector const &  x,
GlobalVector const &  xdot,
const double  t,
double const  dt,
int const  process_id 
)

Calculates secondary variables, e.g. stress and strain for deformation analysis, only after nonlinear solver being successfully conducted.

Definition at line 401 of file Process.cpp.

404 {
407  postNonLinearSolverConcreteProcess(x, xdot, t, dt, process_id);
408 }
virtual void postNonLinearSolverConcreteProcess(GlobalVector const &, GlobalVector const &, const double, double const, int const)
Definition: Process.h:250

References postNonLinearSolverConcreteProcess(), MathLib::LinAlg::setLocalAccessibleVector(), and MathLib::t.

◆ postNonLinearSolverConcreteProcess()

virtual void ProcessLib::Process::postNonLinearSolverConcreteProcess ( GlobalVector const &  ,
GlobalVector const &  ,
const double  ,
double const  ,
int const   
)
inlineprivatevirtual

◆ postTimestep()

void ProcessLib::Process::postTimestep ( std::vector< GlobalVector * > const &  x,
const double  t,
const double  delta_t,
int const  process_id 
)

Postprocessing after a complete timestep.

Definition at line 391 of file Process.cpp.

393 {
394  for (auto* const solution : x)
396  postTimestepConcreteProcess(x, t, delta_t, process_id);
397 
398  _boundary_conditions[process_id].postTimestep(t, x, process_id);
399 }
virtual void postTimestepConcreteProcess(std::vector< GlobalVector * > const &, const double, const double, int const)
Definition: Process.h:242

References _boundary_conditions, postTimestepConcreteProcess(), MathLib::LinAlg::setLocalAccessibleVector(), and MathLib::t.

◆ postTimestepConcreteProcess()

◆ preAssemble()

void ProcessLib::Process::preAssemble ( const double  t,
double const  dt,
GlobalVector const &  x 
)
final

Definition at line 200 of file Process.cpp.

202 {
204 }
virtual void preAssembleConcreteProcess(const double, double const, GlobalVector const &)
Definition: Process.h:216

References preAssembleConcreteProcess(), and MathLib::t.

◆ preAssembleConcreteProcess()

virtual void ProcessLib::Process::preAssembleConcreteProcess ( const double  ,
double const  ,
GlobalVector const &   
)
inlineprivatevirtual

Reimplemented in ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >.

Definition at line 216 of file Process.h.

219  {
220  }

Referenced by preAssemble().

◆ preIteration()

void ProcessLib::Process::preIteration ( const unsigned  iter,
GlobalVector const &  x 
)
final

Definition at line 423 of file Process.cpp.

424 {
427 }
virtual void preIterationConcreteProcess(const unsigned, GlobalVector const &)
Definition: Process.h:256

References preIterationConcreteProcess(), and MathLib::LinAlg::setLocalAccessibleVector().

◆ preIterationConcreteProcess()

virtual void ProcessLib::Process::preIterationConcreteProcess ( const unsigned  ,
GlobalVector const &   
)
inlineprivatevirtual

Reimplemented in ProcessLib::TES::TESProcess.

Definition at line 256 of file Process.h.

258  {
259  }

Referenced by preIteration().

◆ preTimestep()

void ProcessLib::Process::preTimestep ( std::vector< GlobalVector * > const &  x,
const double  t,
const double  delta_t,
const int  process_id 
)

Preprocessing before starting assembly for new timestep.

Definition at line 381 of file Process.cpp.

383 {
384  for (auto* const solution : x)
386  preTimestepConcreteProcess(x, t, delta_t, process_id);
387 
388  _boundary_conditions[process_id].preTimestep(t, x, process_id);
389 }
virtual void preTimestepConcreteProcess(std::vector< GlobalVector * > const &, const double, const double, const int)
Definition: Process.h:234

References _boundary_conditions, preTimestepConcreteProcess(), MathLib::LinAlg::setLocalAccessibleVector(), and MathLib::t.

◆ preTimestepConcreteProcess()

◆ setCoupledSolutionsForStaggeredScheme()

void ProcessLib::Process::setCoupledSolutionsForStaggeredScheme ( CoupledSolutionsForStaggeredScheme *const  coupled_solutions)
inline

Definition at line 94 of file Process.h.

96  {
97  _coupled_solutions = coupled_solutions;
98  }

References _coupled_solutions.

◆ setCoupledTermForTheStaggeredSchemeToLocalAssemblers()

virtual void ProcessLib::Process::setCoupledTermForTheStaggeredSchemeToLocalAssemblers ( int const  )
inlinevirtual

Reimplemented in ProcessLib::HT::HTProcess, and ProcessLib::ComponentTransport::ComponentTransportProcess.

Definition at line 103 of file Process.h.

105  {
106  }

◆ setInitialConditions()

void ProcessLib::Process::setInitialConditions ( std::vector< GlobalVector * > &  process_solutions,
std::vector< GlobalVector * > const &  process_solutions_prev,
double const  t,
int const  process_id 
)

Definition at line 114 of file Process.cpp.

119 {
120  auto& x = *process_solutions[process_id];
121  auto& x_prev = *process_solutions_prev[process_id];
122 
123  // getDOFTableOfProcess can be overloaded by the specific process.
124  auto const& dof_table_of_process = getDOFTable(process_id);
125 
126  auto const& per_process_variables = _process_variables[process_id];
127  for (std::size_t variable_id = 0;
128  variable_id < per_process_variables.size();
129  variable_id++)
130  {
133 
134  auto const& pv = per_process_variables[variable_id];
135  DBUG("Set the initial condition of variable {:s} of process {:d}.",
136  pv.get().getName().data(), process_id);
137 
138  auto const& ic = pv.get().getInitialCondition();
139 
140  auto const num_comp = pv.get().getNumberOfGlobalComponents();
141 
142  for (int component_id = 0; component_id < num_comp; ++component_id)
143  {
144  auto const& mesh_subset =
145  dof_table_of_process.getMeshSubset(variable_id, component_id);
146  auto const mesh_id = mesh_subset.getMeshID();
147  for (auto const* node : mesh_subset.getNodes())
148  {
150  node->getID());
151 
152  pos.setNodeID(node->getID());
153  pos.setCoordinates(*node);
154  auto const& ic_value = ic(t, pos);
155 
156  auto global_index =
157  std::abs(dof_table_of_process.getGlobalIndex(l, variable_id,
158  component_id));
159 #ifdef USE_PETSC
160  // The global indices of the ghost entries of the global
161  // matrix or the global vectors need to be set as negative
162  // values for equation assembly, however the global indices
163  // start from zero. Therefore, any ghost entry with zero
164  // index is assigned an negative value of the vector size
165  // or the matrix dimension. To assign the initial value for
166  // the ghost entries, the negative indices of the ghost
167  // entries are restored to zero.
168  if (global_index == x.size())
169  global_index = 0;
170 #endif
171  x.set(global_index, ic_value[component_id]);
172  }
173  }
174  }
175 
177  MathLib::LinAlg::copy(x, x_prev); // pushState
178 
179  setInitialConditionsConcreteProcess(process_solutions, t, process_id);
180 }
void setNodeID(std::size_t node_id)
void setCoordinates(MathLib::TemplatePoint< double, 3 > const &coordinates)
virtual NumLib::LocalToGlobalIndexMap const & getDOFTable(const int) const
Definition: Process.h:136
virtual void setInitialConditionsConcreteProcess(std::vector< GlobalVector * > &, double const, int const)
Definition: Process.h:209
void finalizeAssembly(PETScMatrix &A)
Definition: LinAlg.cpp:162
void copy(PETScVector const &x, PETScVector &y)
Definition: LinAlg.cpp:37

References _process_variables, MathLib::LinAlg::copy(), DBUG(), MathLib::LinAlg::finalizeAssembly(), getDOFTable(), MeshLib::Node, ParameterLib::SpatialPosition::setCoordinates(), setInitialConditionsConcreteProcess(), MathLib::LinAlg::setLocalAccessibleVector(), ParameterLib::SpatialPosition::setNodeID(), and MathLib::t.

◆ setInitialConditionsConcreteProcess()

◆ solveReactionEquation()

virtual void ProcessLib::Process::solveReactionEquation ( std::vector< GlobalVector * > &  ,
std::vector< GlobalVector * > const &  ,
double const  ,
double const  ,
NumLib::EquationSystem ,
int const   
)
inlinevirtual

Reimplemented in ProcessLib::ComponentTransport::ComponentTransportProcess.

Definition at line 171 of file Process.h.

176  {
177  }

◆ updateDeactivatedSubdomains()

void ProcessLib::Process::updateDeactivatedSubdomains ( double const  time,
const int  process_id 
)

Definition at line 190 of file Process.cpp.

192 {
193  auto const& variables_per_process = getProcessVariables(process_id);
194  for (auto const& variable : variables_per_process)
195  {
196  variable.get().updateDeactivatedSubdomains(time);
197  }
198 }
std::vector< std::reference_wrapper< ProcessVariable > > const & getProcessVariables(const int process_id) const
Definition: Process.h:144

References getProcessVariables().

Member Data Documentation

◆ _boundary_conditions

std::vector<BoundaryConditionCollection> ProcessLib::Process::_boundary_conditions
protected

Vector for boundary conditions. For the monolithic scheme or a single process, the size of the vector is one. For the staggered scheme, the size of vector is the number of the coupled processes.

Definition at line 360 of file Process.h.

Referenced by assemble(), assembleWithJacobian(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(), getKnownSolutions(), initializeProcessBoundaryConditionsAndSourceTerms(), postTimestep(), and preTimestep().

◆ _coupled_solutions

◆ _extrapolator_data

ExtrapolatorData ProcessLib::Process::_extrapolator_data
private

Definition at line 368 of file Process.h.

Referenced by getExtrapolator(), getSingleComponentDOFTable(), and initializeExtrapolator().

◆ _global_assembler

VectorMatrixAssembler ProcessLib::Process::_global_assembler
protected

Definition at line 328 of file Process.h.

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::assembleConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleConcreteProcess(), ProcessLib::HT::HTProcess::assembleConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleConcreteProcess(), ProcessLib::TES::TESProcess::assembleConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HT::HTProcess::assembleWithJacobianConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleWithJacobianConcreteProcess(), ProcessLib::TES::TESProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleWithJacobianConcreteProcess(), and ProcessLib::HeatConduction::HeatConductionProcess::assembleWithJacobianConcreteProcess().

◆ _integration_order

unsigned const ProcessLib::Process::_integration_order
protected

◆ _integration_point_writer

◆ _local_to_global_index_map

std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::Process::_local_to_global_index_map
protected

Definition at line 324 of file Process.h.

Referenced by ProcessLib::ComponentTransport::ComponentTransportProcess::assembleConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleConcreteProcess(), ProcessLib::HT::HTProcess::assembleConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleConcreteProcess(), ProcessLib::TES::TESProcess::assembleConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HT::HTProcess::assembleWithJacobianConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsComponentTransport::RichardsComponentTransportProcess::assembleWithJacobianConcreteProcess(), ProcessLib::RichardsFlow::RichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::assembleWithJacobianConcreteProcess(), ProcessLib::TES::TESProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TES::TESProcess::computeEquilibriumLoading(), ProcessLib::TES::TESProcess::computeRelativeHumidity(), computeSparsityPattern(), ProcessLib::TES::TESProcess::computeVapourPartialPressure(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::constructDofTable(), constructDofTableOfSpecifiedProcessStaggeredScheme(), constructMonolithicProcessDofTable(), ProcessLib::HeatTransportBHE::HeatTransportBHEProcess::createBHEBoundaryConditionTopBottom(), getDOFTable(), getDOFTableForExtrapolatorData(), ProcessLib::HT::HTProcess::getDOFTableForExtrapolatorData(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::getDOFTables(), ProcessLib::ComponentTransport::ComponentTransportProcess::getFlux(), ProcessLib::LiquidFlow::LiquidFlowProcess::getFlux(), ProcessLib::HT::HTProcess::getFlux(), ProcessLib::SteadyStateDiffusion::SteadyStateDiffusion::getFlux(), getMatrixSpecifications(), initialize(), initializeBoundaryConditions(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::initializeConcreteProcess(), ProcessLib::TES::TESProcess::postIterationConcreteProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::preTimestepConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::preTimestepConcreteProcess(), and ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::setInitialConditionsConcreteProcess().

◆ _mesh

◆ _mesh_subset_all_nodes

◆ _process_variables

std::vector<std::vector<std::reference_wrapper<ProcessVariable> > > ProcessLib::Process::_process_variables
protected

◆ _secondary_variables

◆ _source_term_collections

std::vector<SourceTermCollection> ProcessLib::Process::_source_term_collections
private

Vector for nodal source term collections. For the monolithic scheme or a single process, the size of the vector is one. For the staggered scheme, the size of vector is the number of the coupled processes.

Definition at line 366 of file Process.h.

Referenced by assemble(), assembleWithJacobian(), and initializeProcessBoundaryConditionsAndSourceTerms().

◆ _sparsity_pattern

GlobalSparsityPattern ProcessLib::Process::_sparsity_pattern
protected

Definition at line 347 of file Process.h.

Referenced by computeSparsityPattern(), and getMatrixSpecifications().

◆ _use_monolithic_scheme

◆ name

std::string const ProcessLib::Process::name

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