25template <
int DisplacementDim>
 
   29    std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
 
   30    std::vector<std::unique_ptr<ParameterLib::ParameterBase>> 
const& parameters,
 
   31    unsigned const integration_order,
 
   32    std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
 
   36    bool const use_monolithic_scheme)
 
   37    : 
Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
 
   38              integration_order, std::move(process_variables),
 
   39              std::move(secondary_variables), use_monolithic_scheme),
 
   40      _process_data(std::move(process_data))
 
   42    if (use_monolithic_scheme)
 
   45            "Monolithic scheme is not implemented for the HMPhaseField " 
 
   53template <
int DisplacementDim>
 
   59template <
int DisplacementDim>
 
   62    const int process_id)
 const 
   65    if (process_id == _process_data._mechanics_related_process_id)
 
   67        auto const& l = *_local_to_global_index_map;
 
   68        return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
 
   69                &l.getGhostIndices(), &this->_sparsity_pattern};
 
   73    auto const& l = *_local_to_global_index_map_single_component;
 
   74    return {l.dofSizeWithoutGhosts(), l.dofSizeWithoutGhosts(),
 
   75            &l.getGhostIndices(), &_sparsity_pattern_with_single_component};
 
 
   78template <
int DisplacementDim>
 
   83    if (process_id == _process_data._mechanics_related_process_id)
 
   85        return *_local_to_global_index_map;
 
   89    return *_local_to_global_index_map_single_component;
 
 
   92template <
int DisplacementDim>
 
   96    constructDofTableOfSpecifiedProcessStaggeredScheme(
 
   97        _process_data._mechanics_related_process_id);
 
  101    std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
 
  102        *_mesh_subset_all_nodes};
 
  103    _local_to_global_index_map_single_component =
 
  104        std::make_unique<NumLib::LocalToGlobalIndexMap>(
 
  105            std::move(all_mesh_subsets_single_component),
 
  109    assert(_local_to_global_index_map_single_component);
 
  113        *_local_to_global_index_map_single_component, _mesh);
 
 
  116template <
int DisplacementDim>
 
  120    unsigned const integration_order)
 
  128    _secondary_variables.addSecondaryVariable(
 
  131                             DisplacementDim>::RowsAtCompileTime,
 
  132                         getExtrapolator(), _local_assemblers,
 
  133                         &LocalAssemblerInterface::getIntPtSigma));
 
  135    _secondary_variables.addSecondaryVariable(
 
  138                             DisplacementDim>::RowsAtCompileTime,
 
  139                         getExtrapolator(), _local_assemblers,
 
  140                         &LocalAssemblerInterface::getIntPtEpsilon));
 
  142    _secondary_variables.addSecondaryVariable(
 
  145                         &LocalAssemblerInterface::getIntPtWidth));
 
  158        *_local_to_global_index_map);
 
 
  161template <
int DisplacementDim>
 
  163    std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>> 
const& media)
 
  167    initializeProcessBoundaryConditionsAndSourceTerms(
 
  168        *_local_to_global_index_map_single_component,
 
  169        _process_data._phasefield_process_id, media);
 
  171    initializeProcessBoundaryConditionsAndSourceTerms(
 
  172        *_local_to_global_index_map_single_component,
 
  173        _process_data._hydro_process_id, media);
 
  175    initializeProcessBoundaryConditionsAndSourceTerms(
 
  176        *_local_to_global_index_map,
 
  177        _process_data._mechanics_related_process_id, media);
 
 
  180template <
int DisplacementDim>
 
  182    const double , 
double const ,
 
  183    std::vector<GlobalVector*> 
const& ,
 
  184    std::vector<GlobalVector*> 
const& , 
int const ,
 
  188        "HMPhaseFieldLocalAssembler: assembly for the Picard non-linear solver " 
  189        "is not implemented.");
 
 
  192template <
int DisplacementDim>
 
  194    const double t, 
double const dt, std::vector<GlobalVector*> 
const& x,
 
  195    std::vector<GlobalVector*> 
const& x_prev, 
int const process_id,
 
  198    std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
 
  201    if (process_id == _process_data._phasefield_process_id)
 
  204            "Assemble the Jacobian equations of phase field in " 
  205            "HMPhaseFieldProcess for the staggered scheme.");
 
  207    else if (process_id == _process_data._hydro_process_id)
 
  210            "Assemble the Jacobian equations of pressure in " 
  211            "HMPhaseFieldProcess for the staggered scheme.");
 
  216            "Assemble the Jacobian equations of deformation in " 
  217            "HMPhaseFieldProcess for the staggered scheme.");
 
  220    dof_tables.emplace_back(_local_to_global_index_map_single_component.get());
 
  221    dof_tables.emplace_back(_local_to_global_index_map_single_component.get());
 
  222    dof_tables.emplace_back(_local_to_global_index_map.get());
 
  227        _local_assemblers, getActiveElementIDs(), dof_tables, t, dt, x, x_prev,
 
  228        process_id, &b, &Jac);
 
  230    if (process_id == _process_data._mechanics_related_process_id)
 
  233        std::transform(_nodal_forces->begin(), _nodal_forces->end(),
 
  234                       _nodal_forces->begin(), [](
double val) { return -val; });
 
 
  238template <
int DisplacementDim>
 
  240    std::vector<GlobalVector*> 
const& x, 
double const t, 
double const dt,
 
  241    const int process_id)
 
  243    DBUG(
"PreTimestep HMPhaseFieldProcess {}.", process_id);
 
  245    if (process_id == _process_data._phasefield_process_id)
 
  247        DBUG(
"Store the value of phase field at previous time step.");
 
  248        _x_previous_timestep =
 
  255        getActiveElementIDs(), getDOFTable(process_id), *x[process_id], t, dt);
 
 
  258template <
int DisplacementDim>
 
  260    std::vector<GlobalVector*> 
const& x,
 
  261    std::vector<GlobalVector*> 
const& x_prev, 
const double t, 
const double dt,
 
  262    int const process_id)
 
  264    if (process_id == _process_data._phasefield_process_id)
 
  266        DBUG(
"PostTimestep HMPhaseFieldProcess.");
 
  268        _process_data.elastic_energy = 0.0;
 
  269        _process_data.surface_energy = 0.0;
 
  270        _process_data.pressure_work = 0.0;
 
  272        std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
 
  274        dof_tables.emplace_back(
 
  275            _local_to_global_index_map_single_component.get());
 
  276        dof_tables.emplace_back(
 
  277            _local_to_global_index_map_single_component.get());
 
  278        dof_tables.emplace_back(_local_to_global_index_map.get());
 
  281            &LocalAssemblerInterface::computeEnergy, _local_assemblers,
 
  282            getActiveElementIDs(), dof_tables, x, t,
 
  283            _process_data.elastic_energy, _process_data.surface_energy,
 
  284            _process_data.pressure_work);
 
  287                          _process_data.surface_energy,
 
  288                          _process_data.pressure_work);
 
  293        getActiveElementIDs(), getDOFTables(x.size()), x, x_prev, t, dt,
 
 
  297template <
int DisplacementDim>
 
  299    std::vector<GlobalVector*> 
const& x,
 
  300    std::vector<GlobalVector*> 
const& x_prev, 
const double t, 
double const dt,
 
  301    const int process_id)
 
  303    std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
 
  305    dof_tables.emplace_back(_local_to_global_index_map_single_component.get());
 
  306    dof_tables.emplace_back(_local_to_global_index_map_single_component.get());
 
  307    dof_tables.emplace_back(_local_to_global_index_map.get());
 
  309    if (process_id == _process_data._phasefield_process_id)
 
  311        INFO(
"Update fracture width and porous properties");
 
  313            &LocalAssemblerInterface::approximateFractureWidth,
 
  314            _local_assemblers, dof_tables, x, t, dt);
 
  317    if (process_id == _process_data._hydro_process_id)
 
  319        INFO(
"PostNonLinearSolver for Hydro Process");
 
  323            getActiveElementIDs(), getDOFTables(x.size()), x, x_prev, t, dt,
 
 
  328template <
int DisplacementDim>
 
  341        if ((*_x_previous_timestep)[i] > _process_data.irreversible_threshold)
 
 
GlobalMatrix::IndexType GlobalIndexType
 
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
 
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
 
Global vector based on Eigen vector.
 
void copyValues(std::vector< double > &u) const
 
void set(IndexType rowId, double v)
set entry
 
bool isAxiallySymmetric() const
 
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
 
bool isLinear() const override
 
void postTimestepConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &, const double t, const double dt, int const process_id) override
 
void constructDofTable() override
 
HMPhaseFieldProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, unsigned const integration_order, std::vector< std::vector< std::reference_wrapper< ProcessVariable > > > &&process_variables, HMPhaseFieldProcessData< DisplacementDim > &&process_data, SecondaryVariableCollection &&secondary_variables, bool const use_monolithic_scheme)
 
void initializeBoundaryConditions(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media) override
 
void assembleWithJacobianConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector &b, GlobalMatrix &Jac) override
 
void initializeConcreteProcess(NumLib::LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh, unsigned const integration_order) override
Process specific initialization called by initialize().
 
MathLib::MatrixSpecifications getMatrixSpecifications(const int process_id) const override
 
NumLib::LocalToGlobalIndexMap const & getDOFTable(const int process_id) const override
 
void postNonLinearSolverConcreteProcess(std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, const double t, double const dt, int const process_id) override
 
void updateConstraints(GlobalVector &lower, GlobalVector &upper, int const process_id) override
 
void preTimestepConcreteProcess(std::vector< GlobalVector * > const &x, double const t, double const dt, const int process_id) override
 
void assembleConcreteProcess(const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalMatrix &M, GlobalMatrix &K, GlobalVector &b) override
 
MeshLib::PropertyVector< double > * _nodal_forces
 
void postNonLinearSolver(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
virtual void postTimestep(std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, 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 initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
Handles configuration of several secondary variables from the project file.
 
void assembleWithJacobian(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, const double t, double const dt, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, int const process_id, GlobalVector *b, GlobalMatrix *Jac)
 
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
 
void copy(PETScVector const &x, PETScVector &y)
 
void setLocalAccessibleVector(PETScVector const &x)
 
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)
 
@ BY_LOCATION
Ordering data by spatial location.
 
GlobalSparsityPattern computeSparsityPattern(LocalToGlobalIndexMap const &dof_table, MeshLib::Mesh const &mesh)
Computes a sparsity pattern for the given inputs.
 
void showEnergyAndWork(const double t, double &_elastic_energy, double &_surface_energy, double &_pressure_work)
 
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
 
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
 
static void executeSelectedMemberDereferenced(Object &object, Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)
 
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)