24namespace SmallDeformationNonlocal
26template <
int DisplacementDim>
31 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&&
33 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const&
35 unsigned const integration_order,
36 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>&&
40 :
Process(std::move(name), mesh, std::move(jacobian_assembler), parameters,
41 integration_order, std::move(process_variables),
42 std::move(secondary_variables)),
43 _process_data(std::move(process_data))
49 std::make_unique<MeshLib::IntegrationPointWriter>(
56 std::make_unique<MeshLib::IntegrationPointWriter>(
57 "kappa_d_ip", 1 , integration_order,
61template <
int DisplacementDim>
67template <
int DisplacementDim>
71 unsigned const integration_order)
82 std::vector<MeshLib::MeshSubset> all_mesh_subsets_single_component{
83 *_mesh_subset_all_nodes};
84 _local_to_global_index_map_single_component =
85 std::make_unique<NumLib::LocalToGlobalIndexMap>(
86 std::move(all_mesh_subsets_single_component),
93 DisplacementDim>::RowsAtCompileTime,
94 getExtrapolator(), _local_assemblers,
95 &LocalAssemblerInterface::getIntPtSigma));
100 DisplacementDim>::RowsAtCompileTime,
101 getExtrapolator(), _local_assemblers,
102 &LocalAssemblerInterface::getIntPtEpsilon));
107 &LocalAssemblerInterface::getIntPtEpsPV));
111 &LocalAssemblerInterface::getIntPtEpsPDXX));
116 &LocalAssemblerInterface::getIntPtDamage));
119 &LocalAssemblerInterface::nonlocal, _local_assemblers,
126 for (
auto const& ip_writer : _integration_point_writer)
128 auto const& name = ip_writer->name();
131 auto const& mesh_property =
132 *mesh.
getProperties().template getPropertyVector<double>(name +
143 mesh_property.getNumberOfGlobalComponents()))
146 "Both, the field-data ({:s}) and cell-data ({:s}) "
147 "properties are available in the mesh for integration "
148 "point initialization, but only one can be used.",
156 for (std::size_t i = 0; i < _local_assemblers.size(); ++i)
158 auto& local_asm = _local_assemblers[i];
160 std::vector<double> value(
163 mesh_property.getNumberOfGlobalComponents());
167 local_asm->setIPDataInitialConditionsFromCellData(name, value);
175 *_local_to_global_index_map);
178template <
int DisplacementDim>
180 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
181 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
184 DBUG(
"Assemble SmallDeformationNonlocalProcess.");
186 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
187 _local_to_global_index_map.get()};
192 getActiveElementIDs(), dof_table, t, dt, x, x_prev, process_id, &M, &K,
196template <
int DisplacementDim>
198 DisplacementDim>::preAssembleConcreteProcess(
const double t,
202 DBUG(
"preAssemble SmallDeformationNonlocalProcess.");
207 _local_assemblers, getActiveElementIDs(), *_local_to_global_index_map,
211template <
int DisplacementDim>
214 const double t,
double const dt, std::vector<GlobalVector*>
const& x,
215 std::vector<GlobalVector*>
const& x_prev,
int const process_id,
218 DBUG(
"AssembleWithJacobian SmallDeformationNonlocalProcess.");
220 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_table = {
221 _local_to_global_index_map.get()};
226 _local_assemblers, getActiveElementIDs(), dof_table, t, dt, x, x_prev,
227 process_id, &b, &Jac);
230 std::transform(_nodal_forces->begin(), _nodal_forces->end(),
231 _nodal_forces->begin(), [](
double val) { return -val; });
234template <
int DisplacementDim>
237 std::vector<GlobalVector*>
const& x_prev,
240 int const process_id)
242 DBUG(
"PostTimestep SmallDeformationNonlocalProcess.");
243 std::vector<NumLib::LocalToGlobalIndexMap const*> dof_tables;
244 dof_tables.reserve(x.size());
245 std::generate_n(std::back_inserter(dof_tables), x.size(),
246 [&]() { return _local_to_global_index_map.get(); });
250 getActiveElementIDs(), dof_tables, x, x_prev, t, dt, process_id);
253template <
int DisplacementDim>
258 _process_data.crack_volume_old = _process_data.crack_volume;
259 _process_data.crack_volume = 0.0;
261 DBUG(
"PostNonLinearSolver crack volume computation.");
264 &LocalAssemblerInterface::computeCrackIntegral, _local_assemblers,
265 getActiveElementIDs(), *_local_to_global_index_map, x,
266 _process_data.crack_volume);
268 INFO(
"Integral of crack: {:g}", _process_data.crack_volume);
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
bool isAxiallySymmetric() const
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Properties & getProperties()
bool existsPropertyVector(std::string_view name) const
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 initialize(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > _integration_point_writer
SecondaryVariableCollection _secondary_variables
Handles configuration of several secondary variables from the project file.
void addSecondaryVariable(std::string const &internal_name, SecondaryVariableFunctions &&fcts)
void assemble(std::size_t const mesh_item_id, LocalAssemblerInterface &local_assembler, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const 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)
void preAssemble(const std::size_t mesh_item_id, LocalAssemblerInterface &local_assembler, const NumLib::LocalToGlobalIndexMap &dof_table, const double t, double const dt, const GlobalVector &x)
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)
IterationResult
Status flags telling the NonlinearSolver if an iteration succeeded.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
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.
SecondaryVariableFunctions makeExtrapolator(const unsigned num_components, NumLib::Extrapolator &extrapolator, LocalAssemblerCollection const &local_assemblers, typename NumLib::ExtrapolatableLocalAssemblerCollection< LocalAssemblerCollection >::IntegrationPointValuesMethod integration_point_values_method)
void setIPDataInitialConditions(std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const &_integration_point_writer, MeshLib::Properties const &mesh_properties, LocalAssemblersVector &local_assemblers)
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)