From ef7b6d3582d489e622996caf1e514001791c1cab Mon Sep 17 00:00:00 2001 From: Eric Bechet <eric.bechet@ulg.ac.be> Date: Tue, 27 Mar 2012 14:51:39 +0000 Subject: [PATCH] added store function to build a gmodel from an external dataset (based on StoreChain, except that one can add "new" verticies --- Geo/GModel.cpp | 10 ++++++++++ Geo/GModel.h | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 9d96bc5800..279945e4d3 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -977,6 +977,16 @@ void GModel::deleteMeshPartitions() meshPartitions.clear(); } +void GModel::store(std::vector<MVertex*> &vertices, int dim, + std::map<int, std::vector<MElement*> > &entityMap, + std::map<int, std::map<int, std::string> > &physicalMap) +{ + _storeVerticesInEntities(vertices); + _storeElementsInEntities(entityMap); + _storePhysicalTagsInEntities(dim, physicalMap); + _associateEntityWithMeshVertices(); +} + void GModel::storeChain(int dim, std::map<int, std::vector<MElement*> > &entityMap, std::map<int, std::map<int, std::string> > &physicalMap) diff --git a/Geo/GModel.h b/Geo/GModel.h index 6548888797..537d88bd14 100644 --- a/Geo/GModel.h +++ b/Geo/GModel.h @@ -487,6 +487,11 @@ class GModel std::vector<int> &elementary, std::vector<int> &partition); + // for elements cut having new vertices + void store(std::vector<MVertex*> &vertices, int dim, + std::map<int, std::vector<MElement*> > &entityMap, + std::map<int, std::map<int, std::string> > &physicalMap); + // store mesh elements of a chain in a new elementary and physical entity void storeChain(int dim, std::map<int, std::vector<MElement*> > &entityMap, -- GitLab