Commit 7f9b4626 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#9 Replace some mesh argument by the unique id of the mesh (in functions related to Formats).

parent 1c653d2a
......@@ -188,7 +188,7 @@ namespace HappyHeart
switch(format)
{
case Internal::MeshNS::FormatNS::Type::Medit:
Internal::MeshNS::FormatNS::Medit::ReadFile(*this,
Internal::MeshNS::FormatNS::Medit::ReadFile(GetUniqueId(),
mesh_file,
space_unit,
dimension_read,
......@@ -199,7 +199,7 @@ namespace HappyHeart
break;
case Internal::MeshNS::FormatNS::Type::Ensight:
Internal::MeshNS::FormatNS::Ensight::ReadFile(*this,
Internal::MeshNS::FormatNS::Ensight::ReadFile(GetUniqueId(),
mesh_file,
space_unit,
dimension_read,
......
......@@ -104,7 +104,7 @@ namespace HappyHeart
const Coords::vector_shared_ptr& coords_list,
const MeshLabel::const_shared_ptr& label);
MeshLabel::const_shared_ptr EnsightReadLabel(const GeometricMeshRegion& mesh,
MeshLabel::const_shared_ptr EnsightReadLabel(unsigned int mesh_id,
GeometricElt::vector_shared_ptr& geometric_elt_list,
const Coords::vector_shared_ptr& coords_list,
const std::string& mesh_file,
......@@ -124,7 +124,7 @@ namespace HappyHeart
void ReadFile(const GeometricMeshRegion& mesh,
void ReadFile(const unsigned int mesh_id,
const std::string& mesh_file,
double space_unit,
unsigned int& dimension,
......@@ -167,7 +167,7 @@ namespace HappyHeart
// Now read all the geometric geometric elements blocks
while (file_in)
mesh_label_list.push_back(EnsightReadLabel(mesh,
mesh_label_list.push_back(EnsightReadLabel(mesh_id,
unsort_geom_element_list,
coords_list,
mesh_file,
......@@ -403,7 +403,7 @@ namespace HappyHeart
*
*/
template<CoordOrEltStatus CoordOrEltStatusT>
void ReadBlockHelper(const GeometricMeshRegion& mesh,
void ReadBlockHelper(const unsigned int mesh_unique_id,
const std::string& geometric_elt_name,
GeometricElt::vector_shared_ptr& geometric_elt_list,
const Coords::vector_shared_ptr& coords_list,
......@@ -416,8 +416,6 @@ namespace HappyHeart
unsigned int read_ensight_index;
const auto& geometric_elt_factory = ::HappyHeart::Private::GeometricEltFactory::GetInstance();
const auto mesh_unique_id = mesh.GetUniqueId();
while (true)
{
......@@ -465,7 +463,7 @@ namespace HappyHeart
*
* An exception is thrown if any reading from the stream fails, except in the case the end of file was reached.
*/
MeshLabel::const_shared_ptr EnsightReadLabel(const GeometricMeshRegion& mesh,
MeshLabel::const_shared_ptr EnsightReadLabel(const unsigned int mesh_id,
GeometricElt::vector_shared_ptr& geometric_elt_list,
const Coords::vector_shared_ptr& coords_list,
const std::string& mesh_file,
......@@ -497,7 +495,9 @@ namespace HappyHeart
getline(stream, description);
}
auto current_label = std::make_shared<MeshLabel>(mesh.GetUniqueId(), index, std::move(description));
auto current_label = std::make_shared<MeshLabel>(mesh_id,
index,
std::move(description));
const auto& geometric_elt_factory = ::HappyHeart::Private::GeometricEltFactory::GetInstance();
......@@ -541,7 +541,7 @@ namespace HappyHeart
switch(elementStatus)
{
case CoordOrEltStatus::offOrAssign:
ReadBlockHelper<CoordOrEltStatus::offOrAssign>(mesh,
ReadBlockHelper<CoordOrEltStatus::offOrAssign>(mesh_id,
geometric_elt_name,
geometric_elt_list,
coords_list,
......@@ -549,7 +549,7 @@ namespace HappyHeart
stream);
break;
case CoordOrEltStatus::ignore:
ReadBlockHelper<CoordOrEltStatus::ignore>(mesh,
ReadBlockHelper<CoordOrEltStatus::ignore>(mesh_id,
geometric_elt_name,
geometric_elt_list,
coords_list,
......@@ -557,7 +557,7 @@ namespace HappyHeart
stream);
break;
case CoordOrEltStatus::given:
ReadBlockHelper<CoordOrEltStatus::given>(mesh,
ReadBlockHelper<CoordOrEltStatus::given>(mesh_id,
geometric_elt_name,
geometric_elt_list,
coords_list,
......
......@@ -69,10 +69,11 @@ namespace HappyHeart
* \copydoc doxygen_hide_geometric_mesh_region_constructor_4
* \copydoc doxygen_hide_space_unit_arg
* \param[out] dimension Dimension of the mesh, as read in the input file.
* \param[in] mesh
* \param[in] mesh_id Unique identifier of the \a GeometricMeshRegion for the construction of which
* present function is called.
*
*/
void ReadFile(const GeometricMeshRegion& mesh,
void ReadFile(unsigned int mesh_id,
const std::string& mesh_file,
double space_unit,
unsigned int& dimension,
......
......@@ -106,7 +106,7 @@ namespace HappyHeart
{
public:
explicit MeditRead(const GeometricMeshRegion& mesh,
explicit MeditRead(unsigned int mesh_id,
const std::string& medit_filename,
const double space_unit,
Coords::vector_shared_ptr& coords_list,
......@@ -213,7 +213,7 @@ namespace HappyHeart
void ReadFile(const GeometricMeshRegion& mesh,
void ReadFile(const unsigned int mesh_id,
const std::string& file,
double space_unit,
unsigned int& dimension,
......@@ -221,7 +221,7 @@ namespace HappyHeart
Coords::vector_shared_ptr& coords_list,
MeshLabel::vector_const_shared_ptr& mesh_label_list)
{
MeditRead medit(mesh,
MeditRead medit(mesh_id,
file,
space_unit,
coords_list,
......@@ -304,7 +304,7 @@ namespace HappyHeart
{ }
MeditRead::MeditRead(const GeometricMeshRegion& mesh,
MeditRead::MeditRead(const unsigned int mesh_id,
const std::string& medit_filename,
const double space_unit,
Coords::vector_shared_ptr& coords_list,
......@@ -347,13 +347,13 @@ namespace HappyHeart
}
// Local object that won't survive beyond constructor.
LabelHelper label_helper(mesh.GetUniqueId());
LabelHelper label_helper(mesh_id);
// Read coords.
ReadCoords(space_unit, label_helper);
// Read geometric elements.
ReadGeometricElts(mesh.GetUniqueId(), label_helper);
ReadGeometricElts(mesh_id, label_helper);
// Fill label list.
label_helper.LabelList(label_list);
......
......@@ -61,7 +61,7 @@ namespace HappyHeart
* \copydoc doxygen_hide_geometric_mesh_region_constructor_3_bis
* \copydoc doxygen_hide_geometric_mesh_region_constructor_4
*/
void ReadFile(const GeometricMeshRegion& mesh,
void ReadFile(const unsigned int mesh_id,
const std::string& mesh_file,
double space_unit,
unsigned int& dimension,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment