OGS
ProcessLib::ProcessVariable Class Reference

Detailed Description

A named process variable. Its properties includes the mesh, and the initial and boundary conditions as well as the source terms.

Definition at line 60 of file ProcessVariable.h.

#include <ProcessVariable.h>

Collaboration diagram for ProcessLib::ProcessVariable:
[legend]

Public Member Functions

 ProcessVariable (BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
 
 ProcessVariable (ProcessVariable &&)
 
std::string const & getName () const
 
MeshLib::Mesh const & getMesh () const
 Returns a mesh on which the process variable is defined.
 
std::vector< DeactivatedSubdomain > const & getDeactivatedSubdomains () const
 
void updateDeactivatedSubdomains (double const time)
 
std::vector< std::size_t > const & getActiveElementIDs () const
 
int getNumberOfGlobalComponents () const
 Returns the number of components of the process variable.
 
std::vector< std::unique_ptr< BoundaryCondition > > createBoundaryConditions (const NumLib::LocalToGlobalIndexMap &dof_table, const int variable_id, unsigned const integration_order, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, Process const &process, std::vector< std::reference_wrapper< ProcessVariable > > const &all_process_variables_for_this_process)
 
std::vector< std::unique_ptr< SourceTerm > > createSourceTerms (const NumLib::LocalToGlobalIndexMap &dof_table, const int variable_id, unsigned const integration_order, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::vector< std::reference_wrapper< ProcessVariable > > const &all_process_variables_for_this_process)
 
ParameterLib::Parameter< double > const & getInitialCondition () const
 
unsigned getShapeFunctionOrder () const
 
bool compensateNonEquilibriumInitialResiduum () const
 
 ~ProcessVariable ()
 

Private Member Functions

void createBoundaryConditionsForDeactivatedSubDomains (const NumLib::LocalToGlobalIndexMap &dof_table, const int variable_id, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::vector< std::unique_ptr< BoundaryCondition > > &bcs)
 

Private Attributes

std::string const _name
 
MeshLib::Mesh_mesh
 
const int _n_components
 
unsigned _shapefunction_order
 
std::vector< DeactivatedSubdomain_deactivated_subdomains
 
std::vector< std::size_t > _ids_of_active_elements
 
MeshLib::PropertyVector< unsigned char > * _is_active = nullptr
 
ParameterLib::Parameter< double > const & _initial_condition
 
std::vector< BoundaryConditionConfig_bc_configs
 
std::vector< SourceTermConfig_source_term_configs
 
const bool _compensate_non_equilibrium_initial_residuum
 

Constructor & Destructor Documentation

◆ ProcessVariable() [1/2]

ProcessLib::ProcessVariable::ProcessVariable ( BaseLib::ConfigTree const &  config,
MeshLib::Mesh mesh,
std::vector< std::unique_ptr< MeshLib::Mesh > > const &  meshes,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &  parameters,
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &  curves 
)
Input File Parameter:
prj__process_variables__process_variable__boundary_conditions
Input File Parameter:
prj__process_variables__process_variable__boundary_conditions__boundary_condition
Input File Parameter:
prj__process_variables__process_variable__boundary_conditions__boundary_condition__component
Input File Parameter:
prj__process_variables__process_variable__source_terms
Input File Parameter:
prj__process_variables__process_variable__source_terms__source_term
Input File Parameter:
prj__process_variables__process_variable__source_terms__source_term__component

Definition at line 108 of file ProcessVariable.cpp.

115 :
116 _name(config.getConfigParameter<std::string>("name")),
117 _mesh(mesh),
119 _n_components(config.getConfigParameter<int>("components")),
121 _shapefunction_order(config.getConfigParameter<unsigned>("order")),
123 createDeactivatedSubdomains(config, mesh, parameters, curves)),
124 _initial_condition(ParameterLib::findParameter<double>(
126 config.getConfigParameter<std::string>("initial_condition"),
127 parameters, _n_components, &mesh)),
130{
131 DBUG("Constructing process variable {:s}", _name);
132
134 {
135 OGS_FATAL("The given shape function order {:d} is not supported",
137 }
138
139 // Boundary conditions
140 if (auto bcs_config =
142 config.getConfigSubtreeOptional("boundary_conditions"))
143 {
144 for (
145 auto bc_config :
147 bcs_config->getConfigSubtreeList("boundary_condition"))
148 {
149 auto const& bc_mesh = findMeshInConfig(bc_config, meshes);
150 auto component_id =
152 bc_config.getConfigParameterOptional<int>("component");
153
154 if (!component_id && _n_components == 1)
155 {
156 // default value for single component vars.
157 component_id = 0;
158 }
159
160 _bc_configs.emplace_back(std::move(bc_config), bc_mesh,
161 component_id);
162 }
163 }
164 else
165 {
166 INFO("No boundary conditions for process variable '{:s}' found.",
167 _name);
168 }
169
170 // Source terms
172 if (auto sts_config = config.getConfigSubtreeOptional("source_terms"))
173 {
174 for (
175 auto st_config :
177 sts_config->getConfigSubtreeList("source_term"))
178 {
179 MeshLib::Mesh const& st_mesh = findMeshInConfig(st_config, meshes);
180 auto component_id =
182 st_config.getConfigParameterOptional<int>("component");
183
184 if (!component_id && _n_components == 1)
185 {
186 // default value for single component vars.
187 component_id = 0;
188 }
189
190 _source_term_configs.emplace_back(std::move(st_config), st_mesh,
191 component_id);
192 }
193 }
194 else
195 {
196 INFO("No source terms for process variable '{:s}' found.", _name);
197 }
198
199 if (!_deactivated_subdomains.empty())
200 {
201 _is_active = getOrCreateMeshProperty<unsigned char>(
202 _mesh, _name + "_active", MeshLib::MeshItemType::Cell, 1);
203 std::fill(std::begin(*_is_active), std::end(*_is_active), 1u);
204 }
205}
#define OGS_FATAL(...)
Definition: Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:30
ParameterLib::Parameter< double > const & _initial_condition
std::vector< BoundaryConditionConfig > _bc_configs
std::vector< DeactivatedSubdomain > _deactivated_subdomains
const bool _compensate_non_equilibrium_initial_residuum
MeshLib::PropertyVector< unsigned char > * _is_active
std::vector< SourceTermConfig > _source_term_configs
bool parseCompensateNonEquilibriumInitialResiduum(BaseLib::ConfigTree const &config)
std::vector< DeactivatedSubdomain > createDeactivatedSubdomains(BaseLib::ConfigTree const &config, MeshLib::Mesh const &mesh, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
MeshLib::Mesh const & findMeshInConfig(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes)

References _bc_configs, _deactivated_subdomains, _is_active, _mesh, _n_components, _name, _shapefunction_order, _source_term_configs, MeshLib::Cell, DBUG(), BaseLib::ConfigTree::getConfigSubtreeOptional(), INFO(), and OGS_FATAL.

◆ ProcessVariable() [2/2]

ProcessLib::ProcessVariable::ProcessVariable ( ProcessVariable &&  )
default

◆ ~ProcessVariable()

ProcessLib::ProcessVariable::~ProcessVariable ( )
default

Member Function Documentation

◆ compensateNonEquilibriumInitialResiduum()

bool ProcessLib::ProcessVariable::compensateNonEquilibriumInitialResiduum ( ) const
inline

◆ createBoundaryConditions()

std::vector< std::unique_ptr< BoundaryCondition > > ProcessLib::ProcessVariable::createBoundaryConditions ( const NumLib::LocalToGlobalIndexMap dof_table,
const int  variable_id,
unsigned const  integration_order,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &  parameters,
Process const &  process,
std::vector< std::reference_wrapper< ProcessVariable > > const &  all_process_variables_for_this_process 
)

Definition at line 220 of file ProcessVariable.cpp.

228{
229 std::vector<std::unique_ptr<BoundaryCondition>> bcs;
230 bcs.reserve(_bc_configs.size());
231
232 for (auto& config : _bc_configs)
233 {
234 auto bc = createBoundaryCondition(
235 config, dof_table, _mesh, variable_id, integration_order,
236 _shapefunction_order, parameters, process,
237 all_process_variables_for_this_process);
238#ifdef USE_PETSC
239 if (bc == nullptr)
240 {
241 continue;
242 }
243#endif // USE_PETSC
244 bcs.push_back(std::move(bc));
245 }
246
248 parameters, bcs);
249
250 return bcs;
251}
void createBoundaryConditionsForDeactivatedSubDomains(const NumLib::LocalToGlobalIndexMap &dof_table, const int variable_id, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::vector< std::unique_ptr< BoundaryCondition > > &bcs)
std::unique_ptr< BoundaryCondition > createBoundaryCondition(const BoundaryConditionConfig &config, const NumLib::LocalToGlobalIndexMap &dof_table, const MeshLib::Mesh &bulk_mesh, const int variable_id, const unsigned integration_order, const unsigned shapefunction_order, const std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, const Process &process, std::vector< std::reference_wrapper< ProcessVariable > > const &all_process_variables_for_this_process)

References _bc_configs, _mesh, _shapefunction_order, ProcessLib::createBoundaryCondition(), and createBoundaryConditionsForDeactivatedSubDomains().

Referenced by ProcessLib::BoundaryConditionCollection::addBCsForProcessVariables().

◆ createBoundaryConditionsForDeactivatedSubDomains()

void ProcessLib::ProcessVariable::createBoundaryConditionsForDeactivatedSubDomains ( const NumLib::LocalToGlobalIndexMap dof_table,
const int  variable_id,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &  parameters,
std::vector< std::unique_ptr< BoundaryCondition > > &  bcs 
)
private

Definition at line 253 of file ProcessVariable.cpp.

257{
258 for (auto const& deactivated_subdomain : _deactivated_subdomains)
259 {
260 auto const& deactivated_subdomain_mesh =
261 deactivated_subdomain.deactivated_subdomain_mesh;
262 auto const* parameter = &ParameterLib::findParameter<double>(
264 bool const set_outer_nodes_dirichlet_values =
265 deactivated_subdomain.boundary_value_parameter != nullptr;
266 if (set_outer_nodes_dirichlet_values)
267 {
268 parameter = deactivated_subdomain.boundary_value_parameter;
269 }
270
271 for (int component_id = 0;
272 component_id <
273 dof_table.getNumberOfVariableComponents(variable_id);
274 component_id++)
275 {
276 auto bc = std::make_unique<DeactivatedSubdomainDirichlet>(
277 *_is_active, deactivated_subdomain.time_interval, *parameter,
278 set_outer_nodes_dirichlet_values, deactivated_subdomain_mesh,
279 dof_table, variable_id, component_id);
280
281#ifdef USE_PETSC
282 // TODO: make it work under PETSc too.
283 if (bc == nullptr)
284 {
285 continue;
286 }
287#endif // USE_PETSC
288 bcs.push_back(std::move(bc));
289 }
290 }
291}
int getNumberOfVariableComponents(int variable_id) const
static PROCESSLIB_EXPORT const std::string zero_parameter_name

References _deactivated_subdomains, _is_active, NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents(), and ProcessLib::DeactivatedSubdomain::zero_parameter_name.

Referenced by createBoundaryConditions().

◆ createSourceTerms()

std::vector< std::unique_ptr< SourceTerm > > ProcessLib::ProcessVariable::createSourceTerms ( const NumLib::LocalToGlobalIndexMap dof_table,
const int  variable_id,
unsigned const  integration_order,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &  parameters,
std::vector< std::reference_wrapper< ProcessVariable > > const &  all_process_variables_for_this_process 
)

Definition at line 349 of file ProcessVariable.cpp.

356{
357 std::vector<std::unique_ptr<SourceTerm>> source_terms;
358
359 transform(cbegin(_source_term_configs), cend(_source_term_configs),
360 back_inserter(source_terms),
361 [&](auto const& config)
362 {
363 return createSourceTerm(
364 config, dof_table, config.mesh, variable_id,
365 integration_order, _shapefunction_order, parameters,
366 all_process_variables_for_this_process);
367 });
368
369 return source_terms;
370}
std::unique_ptr< SourceTerm > createSourceTerm(const SourceTermConfig &config, const NumLib::LocalToGlobalIndexMap &dof_table_bulk, const MeshLib::Mesh &source_term_mesh, const int variable_id, const unsigned integration_order, const unsigned shapefunction_order, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::vector< std::reference_wrapper< ProcessVariable > > const &all_process_variables_for_this_process)

References _shapefunction_order, _source_term_configs, and ProcessLib::createSourceTerm().

Referenced by ProcessLib::SourceTermCollection::addSourceTermsForProcessVariables().

◆ getActiveElementIDs()

std::vector< std::size_t > const & ProcessLib::ProcessVariable::getActiveElementIDs ( ) const
inline

Definition at line 86 of file ProcessVariable.h.

87 {
89 }
std::vector< std::size_t > _ids_of_active_elements

References _ids_of_active_elements.

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::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::AssemblyMixin< Process >::assembleGeneric(), 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::ThermalTwoPhaseFlowWithPP::ThermalTwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoMechanics::ThermoMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPP::TwoPhaseFlowWithPPProcess::assembleWithJacobianConcreteProcess(), ProcessLib::TwoPhaseFlowWithPrho::TwoPhaseFlowWithPrhoProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HeatConduction::HeatConductionProcess::assembleWithJacobianConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::assembleWithJacobianConcreteProcess(), 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, ConstitutiveTraits >::computeSecondaryVariableConcrete(), ProcessLib::ComponentTransport::ComponentTransportProcess::computeSecondaryVariableConcrete(), ProcessLib::StokesFlow::StokesFlowProcess< GlobalDim >::computeSecondaryVariableConcrete(), 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::HT::HTProcess::postTimestepConcreteProcess(), ProcessLib::PhaseField::PhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::postTimestepConcreteProcess(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::LiquidFlow::LiquidFlowProcess::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::SteadyStateDiffusion::SteadyStateDiffusion::postTimestepConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoRichardsFlow::ThermoRichardsFlowProcess::postTimestepConcreteProcess(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsProcess< DisplacementDim, ConstitutiveTraits >::postTimestepConcreteProcess(), ProcessLib::LIE::HydroMechanics::HydroMechanicsProcess< GlobalDim >::postTimestepConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldProcess< DisplacementDim >::postTimestepConcreteProcess(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalProcess< DisplacementDim >::preAssembleConcreteProcess(), 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::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), ProcessLib::RichardsMechanics::RichardsMechanicsProcess< DisplacementDim >::setInitialConditionsConcreteProcess(), ProcessLib::ComponentTransport::ComponentTransportProcess::solveReactionEquation(), ProcessLib::AssemblyMixinBase::updateActiveElements(), and ProcessLib::AssemblyMixinBase::updateActiveElementsImpl().

◆ getDeactivatedSubdomains()

std::vector< DeactivatedSubdomain > const & ProcessLib::ProcessVariable::getDeactivatedSubdomains ( ) const
inline

Definition at line 79 of file ProcessVariable.h.

80 {
82 }

References _deactivated_subdomains.

◆ getInitialCondition()

ParameterLib::Parameter< double > const & ProcessLib::ProcessVariable::getInitialCondition ( ) const
inline

◆ getMesh()

MeshLib::Mesh const & ProcessLib::ProcessVariable::getMesh ( ) const

Returns a mesh on which the process variable is defined.

Definition at line 214 of file ProcessVariable.cpp.

215{
216 return _mesh;
217}

References _mesh.

◆ getName()

◆ getNumberOfGlobalComponents()

◆ getShapeFunctionOrder()

◆ updateDeactivatedSubdomains()

void ProcessLib::ProcessVariable::updateDeactivatedSubdomains ( double const  time)

Definition at line 293 of file ProcessVariable.cpp.

294{
295 if (_deactivated_subdomains.empty())
296 {
297 return;
298 }
299
301
302 // If none of the deactivated subdomains is active at current time, then the
303 // _ids_of_active_elements remain empty.
304 if (std::none_of(
306 [&](auto const& ds) { return ds.isInTimeSupportInterval(time); }))
307 {
308 // Also mark all of the elements as active.
309 assert(_is_active != nullptr); // guaranteed by constructor
310 std::fill(std::begin(*_is_active), std::end(*_is_active), 1u);
311
312 return;
313 }
314
315 auto is_active_in_subdomain = [&](std::size_t const element_id,
316 DeactivatedSubdomain const& ds) -> bool
317 {
318 return (!ds.isInTimeSupportInterval(time)) ||
319 !ds.isDeactivated(*_mesh.getElement(element_id), time);
320 };
321
322 auto is_active_in_all_subdomains = [&](std::size_t const element_id) -> bool
323 {
324 return std::all_of(begin(_deactivated_subdomains),
326 [&](auto const& ds)
327 { return is_active_in_subdomain(element_id, ds); });
328 };
329
330 auto const number_of_elements = _mesh.getNumberOfElements();
331 for (std::size_t element_id = 0; element_id < number_of_elements;
332 element_id++)
333 {
334 if (is_active_in_all_subdomains(element_id))
335 {
336 _ids_of_active_elements.push_back(element_id);
337 }
338 }
339
340 // all elements are deactivated
341 std::fill(std::begin(*_is_active), std::end(*_is_active), 0u);
342
343 for (auto const id : _ids_of_active_elements)
344 {
345 (*_is_active)[id] = 1u;
346 }
347}
const Element * getElement(std::size_t idx) const
Get the element with the given index.
Definition: Mesh.h:89
std::size_t getNumberOfElements() const
Get the number of elements.
Definition: Mesh.h:92

References _deactivated_subdomains, _ids_of_active_elements, _is_active, _mesh, MeshLib::Mesh::getElement(), and MeshLib::Mesh::getNumberOfElements().

Member Data Documentation

◆ _bc_configs

std::vector<BoundaryConditionConfig> ProcessLib::ProcessVariable::_bc_configs
private

Definition at line 159 of file ProcessVariable.h.

Referenced by ProcessVariable(), and createBoundaryConditions().

◆ _compensate_non_equilibrium_initial_residuum

const bool ProcessLib::ProcessVariable::_compensate_non_equilibrium_initial_residuum
private

Definition at line 162 of file ProcessVariable.h.

Referenced by compensateNonEquilibriumInitialResiduum().

◆ _deactivated_subdomains

std::vector<DeactivatedSubdomain> ProcessLib::ProcessVariable::_deactivated_subdomains
private

◆ _ids_of_active_elements

std::vector<std::size_t> ProcessLib::ProcessVariable::_ids_of_active_elements
mutableprivate

IDs of the active elements. It is initialized only if there are deactivated subdomains.

Definition at line 148 of file ProcessVariable.h.

Referenced by getActiveElementIDs(), and updateDeactivatedSubdomains().

◆ _initial_condition

ParameterLib::Parameter<double> const& ProcessLib::ProcessVariable::_initial_condition
private

Definition at line 157 of file ProcessVariable.h.

Referenced by getInitialCondition().

◆ _is_active

MeshLib::PropertyVector<unsigned char>* ProcessLib::ProcessVariable::_is_active = nullptr
private

◆ _mesh

MeshLib::Mesh& ProcessLib::ProcessVariable::_mesh
private

◆ _n_components

const int ProcessLib::ProcessVariable::_n_components
private

Definition at line 128 of file ProcessVariable.h.

Referenced by ProcessVariable(), and getNumberOfGlobalComponents().

◆ _name

std::string const ProcessLib::ProcessVariable::_name
private

Definition at line 126 of file ProcessVariable.h.

Referenced by ProcessVariable(), and getName().

◆ _shapefunction_order

unsigned ProcessLib::ProcessVariable::_shapefunction_order
private

The polynomial order of the process variable's shape functions.

Requires an appropriate mesh.

The order of the shape functions can not be higher than the maximum available order for the underlying geometric elements. For example the second order shape functions for a hexahedron are only possible if the geometric element is at least a 20-node hexahedron element (MeshLib::TemplateElement<MeshLib::HexRule20>), whereas linear shape functions are also available on the 8-node hexahedron (MeshLib::TemplateElement<MeshLib::HexRule8>).

See also
MeshLib::CellRule MeshLib::FaceRule MeshLib::EdgeRule.

Definition at line 142 of file ProcessVariable.h.

Referenced by ProcessVariable(), createBoundaryConditions(), createSourceTerms(), and getShapeFunctionOrder().

◆ _source_term_configs

std::vector<SourceTermConfig> ProcessLib::ProcessVariable::_source_term_configs
private

Definition at line 160 of file ProcessVariable.h.

Referenced by ProcessVariable(), and createSourceTerms().


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