diff --git a/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp index 9d78afae37c..6b80d734f3c 100644 --- a/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp +++ b/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp @@ -181,10 +181,10 @@ std::unique_ptr createSmallDeformationProcess( config.getConfigParameter( "reference_temperature", std::numeric_limits::quiet_NaN()); - SmallDeformationProcessData process_data( + SmallDeformationProcessData process_data{ materialIDs(mesh), std::move(solid_constitutive_relations), std::move(fracture_model), std::move(fracture_properties), - reference_temperature); + reference_temperature}; SecondaryVariableCollection secondary_variables; diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h index 72a7f8942fd..28ac21e1841 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerFracture-impl.h @@ -56,16 +56,16 @@ SmallDeformationLocalAssemblerFracture:: _ip_data.reserve(n_integration_points); _secondary_data.N.resize(n_integration_points); - auto mat_id = (*_process_data._mesh_prop_materialIDs)[e.getID()]; - auto frac_id = _process_data._map_materialID_to_fractureID[mat_id]; + auto mat_id = (*_process_data.mesh_prop_materialIDs)[e.getID()]; + auto frac_id = _process_data.map_materialID_to_fractureID[mat_id]; _fracture_property = &_process_data.fracture_properties[frac_id]; - for (auto fid : process_data._vec_ele_connected_fractureIDs[e.getID()]) + for (auto fid : process_data.vec_ele_connected_fractureIDs[e.getID()]) { _fracID_to_local.insert({fid, _fracture_props.size()}); _fracture_props.push_back(&_process_data.fracture_properties[fid]); } - _junction_props = process_data._vec_ele_connected_junctionIDs[e.getID()] | + _junction_props = process_data.vec_ele_connected_junctionIDs[e.getID()] | ranges::views::transform( [&](auto const jid) { return &_process_data.junction_properties[jid]; }) | @@ -77,7 +77,7 @@ SmallDeformationLocalAssemblerFracture:: { x_position.setIntegrationPoint(ip); - _ip_data.emplace_back(*_process_data._fracture_model); + _ip_data.emplace_back(*_process_data.fracture_model); auto const& sm = _shape_matrices[ip]; auto& ip_data = _ip_data[ip]; ip_data.integration_weight = @@ -339,7 +339,7 @@ void SmallDeformationLocalAssemblerFracture:: ele_b /= n_integration_points; ele_w /= n_integration_points; ele_sigma /= n_integration_points; - (*_process_data._mesh_prop_b)[_element.getID()] = ele_b; + (*_process_data.mesh_prop_b)[_element.getID()] = ele_b; Eigen::Map( &(*_process_data.element_fracture_stresses)[e_id * DisplacementDim]) = diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h index 750193bc5ce..ac303ab98f2 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrix-impl.h @@ -151,7 +151,7 @@ void SmallDeformationLocalAssemblerMatrix:: variables_prev.mechanical_strain .emplace>( eps_prev); - variables_prev.temperature = _process_data._reference_temperature; + variables_prev.temperature = _process_data.reference_temperature; auto&& solution = _ip_data[ip]._solid_material.integrateStress( variables_prev, variables, t, x_position, dt, *state); diff --git a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h index ae5a12b8d04..00ad793ba9f 100644 --- a/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h +++ b/ProcessLib/LIE/SmallDeformation/LocalAssembler/SmallDeformationLocalAssemblerMatrixNearFracture-impl.h @@ -103,13 +103,13 @@ SmallDeformationLocalAssemblerMatrixNearFracture>( eps_prev); - variables_prev.temperature = _process_data._reference_temperature; + variables_prev.temperature = _process_data.reference_temperature; auto&& solution = _ip_data[ip]._solid_material.integrateStress( variables_prev, variables, t, x_position, dt, *state); diff --git a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp index ce7ae11c8e7..2701e92ef54 100644 --- a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcess.cpp @@ -67,21 +67,21 @@ SmallDeformationProcess::SmallDeformationProcess( // create a map from a material ID to a fracture ID auto max_frac_mat_id = std::max_element(_vec_fracture_mat_IDs.begin(), _vec_fracture_mat_IDs.end()); - _process_data._map_materialID_to_fractureID.resize(*max_frac_mat_id + 1); + _process_data.map_materialID_to_fractureID.resize(*max_frac_mat_id + 1); for (unsigned i = 0; i < _vec_fracture_mat_IDs.size(); i++) { - _process_data._map_materialID_to_fractureID[_vec_fracture_mat_IDs[i]] = + _process_data.map_materialID_to_fractureID[_vec_fracture_mat_IDs[i]] = i; } // create a table of connected fracture IDs for each element - _process_data._vec_ele_connected_fractureIDs.resize( + _process_data.vec_ele_connected_fractureIDs.resize( mesh.getNumberOfElements()); for (unsigned i = 0; i < _vec_fracture_matrix_elements.size(); i++) { for (auto e : _vec_fracture_matrix_elements[i]) { - _process_data._vec_ele_connected_fractureIDs[e->getID()].push_back( + _process_data.vec_ele_connected_fractureIDs[e->getID()].push_back( i); } } @@ -103,10 +103,10 @@ SmallDeformationProcess::SmallDeformationProcess( auto slave_matId = matID[1]; auto& master_frac = _process_data.fracture_properties - [_process_data._map_materialID_to_fractureID[master_matId]]; + [_process_data.map_materialID_to_fractureID[master_matId]]; auto& slave_frac = _process_data.fracture_properties - [_process_data._map_materialID_to_fractureID[slave_matId]]; + [_process_data.map_materialID_to_fractureID[slave_matId]]; master_frac.branches_master.push_back(createBranchProperty( *mesh.getNode(vec_branch_nodeID), master_frac, slave_frac)); @@ -130,8 +130,8 @@ SmallDeformationProcess::SmallDeformationProcess( auto const& material_ids = vec_junction_nodeID_matIDs[i].second; assert(material_ids.size() == 2); std::array fracture_ids{ - {_process_data._map_materialID_to_fractureID[material_ids[0]], - _process_data._map_materialID_to_fractureID[material_ids[1]]}}; + {_process_data.map_materialID_to_fractureID[material_ids[0]], + _process_data.map_materialID_to_fractureID[material_ids[1]]}}; _process_data.junction_properties.emplace_back( i, *mesh.getNode(vec_junction_nodeID_matIDs[i].first), @@ -139,7 +139,7 @@ SmallDeformationProcess::SmallDeformationProcess( } // create a table of connected junction IDs for each element - _process_data._vec_ele_connected_junctionIDs.resize( + _process_data.vec_ele_connected_junctionIDs.resize( mesh.getNumberOfElements()); for (unsigned i = 0; i < vec_junction_nodeID_matIDs.size(); i++) { @@ -147,7 +147,7 @@ SmallDeformationProcess::SmallDeformationProcess( for (auto id : mesh.getElementsConnectedToNode(*node) | MeshLib::views::ids) { - _process_data._vec_ele_connected_junctionIDs[id].push_back(i); + _process_data.vec_ele_connected_junctionIDs[id].push_back(i); } } @@ -173,7 +173,7 @@ SmallDeformationProcess::SmallDeformationProcess( MeshLib::PropertyVector const* material_ids( mesh.getProperties().getPropertyVector("MaterialIDs")); - _process_data._mesh_prop_materialIDs = material_ids; + _process_data.mesh_prop_materialIDs = material_ids; } template @@ -304,8 +304,7 @@ void SmallDeformationProcess::initializeConcreteProcess( std::vector e_fracture_props; std::unordered_map e_fracID_to_local; unsigned tmpi = 0; - for (auto fid : - _process_data._vec_ele_connected_fractureIDs[e->getID()]) + for (auto fid : _process_data.vec_ele_connected_fractureIDs[e->getID()]) { e_fracture_props.push_back(&_process_data.fracture_properties[fid]); e_fracID_to_local.insert({fid, tmpi++}); @@ -313,8 +312,7 @@ void SmallDeformationProcess::initializeConcreteProcess( std::vector e_junction_props; std::unordered_map e_juncID_to_local; tmpi = 0; - for (auto fid : - _process_data._vec_ele_connected_junctionIDs[e->getID()]) + for (auto fid : _process_data.vec_ele_connected_junctionIDs[e->getID()]) { e_junction_props.push_back(&_process_data.junction_properties[fid]); e_juncID_to_local.insert({fid, tmpi++}); @@ -361,7 +359,7 @@ void SmallDeformationProcess::initializeConcreteProcess( MeshLib::MeshItemType::Cell, 1); mesh_prop_b->resize(mesh.getNumberOfElements()); - auto const& mesh_prop_matid = *_process_data._mesh_prop_materialIDs; + auto const& mesh_prop_matid = *_process_data.mesh_prop_materialIDs; for (auto const& fracture_prop : _process_data.fracture_properties) { for (MeshLib::Element const* e : _mesh.getElements()) @@ -382,7 +380,7 @@ void SmallDeformationProcess::initializeConcreteProcess( .mean(); } } - _process_data._mesh_prop_b = mesh_prop_b; + _process_data.mesh_prop_b = mesh_prop_b; } template diff --git a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcessData.h b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcessData.h index d42765d36bb..aee0519a687 100644 --- a/ProcessLib/LIE/SmallDeformation/SmallDeformationProcessData.h +++ b/ProcessLib/LIE/SmallDeformation/SmallDeformationProcessData.h @@ -32,36 +32,6 @@ namespace SmallDeformation template struct SmallDeformationProcessData { - SmallDeformationProcessData( - MeshLib::PropertyVector const* const material_ids_, - std::map>>&& - solid_materials_, - std::unique_ptr< - MaterialLib::Fracture::FractureModelBase>&& - fracture_model, - std::vector&& fracture_properties_, - double const reference_temperature) - : material_ids(material_ids_), - solid_materials{std::move(solid_materials_)}, - _fracture_model{std::move(fracture_model)}, - fracture_properties(std::move(fracture_properties_)), - _reference_temperature(reference_temperature) - { - } - - SmallDeformationProcessData(SmallDeformationProcessData&& other) = default; - - //! Copies are forbidden. - SmallDeformationProcessData(SmallDeformationProcessData const&) = delete; - - //! Assignments are not needed. - void operator=(SmallDeformationProcessData const&) = delete; - - //! Assignments are not needed. - void operator=(SmallDeformationProcessData&&) = delete; - MeshLib::PropertyVector const* const material_ids; /// The constitutive relation for the mechanical part. @@ -71,16 +41,19 @@ struct SmallDeformationProcessData solid_materials; std::unique_ptr> - _fracture_model; + fracture_model; std::vector fracture_properties; - std::vector junction_properties; - MeshLib::PropertyVector const* _mesh_prop_materialIDs = nullptr; - std::vector _map_materialID_to_fractureID; + double const reference_temperature; + + std::vector junction_properties = {}; + + MeshLib::PropertyVector const* mesh_prop_materialIDs = nullptr; + std::vector map_materialID_to_fractureID = {}; // a table of connected fracture IDs for each element - std::vector> _vec_ele_connected_fractureIDs; - std::vector> _vec_ele_connected_junctionIDs; + std::vector> vec_ele_connected_fractureIDs = {}; + std::vector> vec_ele_connected_junctionIDs = {}; // mesh properties to output element's stress. MeshLib::PropertyVector* element_stresses = nullptr; @@ -88,9 +61,7 @@ struct SmallDeformationProcessData MeshLib::PropertyVector* element_fracture_stresses = nullptr; // mesh property for fracture aperture - MeshLib::PropertyVector* _mesh_prop_b = nullptr; - - double const _reference_temperature; + MeshLib::PropertyVector* mesh_prop_b = nullptr; }; } // namespace SmallDeformation