Commit 94149bdc authored by Koen Hillewaert's avatar Koen Hillewaert

matching to CAD : removed creation of faulty creation of topology; copied…

matching to CAD : removed creation of faulty creation of topology; copied physical data from original GModel
parent 2f9ee4c7
......@@ -60,7 +60,7 @@ public: // these will become protected at some point
// corresponding principal vertices
std::map<GVertex *, GVertex *> vertexCounterparts;
// the physical entitites (if any) that contain this entity
std::vector<int> physicals;
......
......@@ -177,7 +177,7 @@ protected:
void
_storePhysicalTagsInEntities(int dim,
std::map<int, std::map<int, std::string> > &map);
public:
// region, face, edge and vertex iterators
typedef std::set<GRegion *, GEntityLessThan>::iterator riter;
......
......@@ -353,13 +353,7 @@ createElementMSH(GModel *m, int num,
elements[9][reg].push_back(e); break;
default : Msg::Error("Wrong type of element"); return NULL;
}
/*
int dim = e->getDim();
if(physical && (!physicals[dim].count(reg) || !physicals[dim][reg].count(physical)))
physicals[dim][reg][physical] = "unnamed";
*/
//if(part) m->getMeshPartitions().insert(part);
return e;
}
......@@ -1312,7 +1306,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
// --- global containers and indices for points and elements
std::map<int, std::vector<MElement*> > eltMap[10];
std::vector<MVertex*> vertices;
std::vector<MVertex*> newVertices;
// --- keep connectivity information
......@@ -1408,7 +1402,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
// --- using an offset to translate zone local numbering to global numbering
int vtxOffset = vertices.size();
int vtxOffset = newVertices.size();
// --- check that this is an unstructured zone
// we can later add ijk here to allow for mixed meshes
......@@ -1450,7 +1444,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
}
char zoneFamilyName[maxLenCGNS];
int zoneFamilyIndex;
//int zoneFamilyIndex;
int ierr = cg_famname_read(zoneFamilyName);
......@@ -1463,11 +1457,12 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
if (ierr == CG_OK) {
Msg::Info("Zone %i has family name %s",zoneIndex,zoneFamilyName);
map<string,int>::iterator fIter = family.find(zoneFamilyName);
if (fIter != family.end()) zoneFamilyIndex = fIter->second;
else Msg::Error("%s (%i) : Error reading CGNS file %s : "
"cannot find CGNS family in available list",
__FILE__,__LINE__,fileName.c_str());
// if (fIter != family.end()) zoneFamilyIndex = fIter->second;
if (fIter == family.end()) {
Msg::Error("%s (%i) : Error reading CGNS file %s : "
"cannot find CGNS family in available list",
__FILE__,__LINE__,fileName.c_str());
}
}
// --- read coordinates and create vertices
......@@ -1481,7 +1476,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
scale,
NULL,
vtxIndex,
vertices);
newVertices);
Msg::Info("Read %i points",nbPoints);
......@@ -1576,7 +1571,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
for (int iVtx=0;iVtx<eltSize;iVtx++) {
int num = vtxOffset + pElt[renum[iVtx]]-1;
vtcs.push_back(vertices[num]);
vtcs.push_back(newVertices[num]);
}
int topoIndex = zoneIndex;
......@@ -1614,7 +1609,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
rIter!=renumbering.end();++rIter) delete [] rIter->second;
removeDuplicateMeshVertices(1e-8);
for(int i = 0; i < 10 ; i++) _storeElementsInEntities(eltMap[i]);
if(CTX::instance()->mesh.cgnsConstructTopology)
......@@ -1633,7 +1628,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
}
_associateEntityWithMeshVertices();
_storeVerticesInEntities(vertices);
_storeVerticesInEntities(newVertices);
// add physical entities corresponding to the bc and zones
......@@ -1660,7 +1655,7 @@ int GModel::_readCGNSUnstructured(const std::string& fileName)
}
_storePhysicalTagsInEntities(meshDim,physicalZones);
//_createGeometryOfDiscreteEntities();
return 1;
......@@ -2143,8 +2138,7 @@ int GModel::_readCGNSStructured(const std::string &name)
}
removeDuplicateMeshVertices(1e-8);
//createTopologyFromMesh();
if ( cg_close (index_file) ) {
Msg::Error("Couldn't close the file !");
return 0;
......@@ -3101,7 +3095,7 @@ int write_CGNS_zones(GModel &model, const int zoneDefinition, const int numZone,
} // End master thread instructions
} // End omp parallel section
//--Destroy omp locks
//--Destroy omp locks
omp_destroy_lock(&threadWLock);
omp_destroy_lock(&queueLock);
......
This diff is collapsed.
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