#endif
-static const SMDS_MeshNode*
-FindNode(const SMDS_Mesh* theMesh, int theId){
- const SMDS_MeshNode* aNode = theMesh->FindNode(theId);
- if(aNode) return aNode;
- EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
-}
-
-
Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
{
Status aResult = DRS_OK;
for(; anIter != aDataSet2411.end(); anIter++){
const TNodeLab& aLabel = anIter->first;
const TRecord& aRec = anIter->second;
- const SMDS_MeshNode* aNode =
- myMesh->AddNodeWithID(aRec.coord[0],aRec.coord[1],aRec.coord[2],aLabel);
+ myMesh->AddNodeWithID(aRec.coord[0],aRec.coord[1],aRec.coord[2],aLabel);
}
}
{
SMDS_MeshElement* anElement = NULL;
const TElementLab& aLabel = anIter->first;
const TRecord& aRec = anIter->second;
- int aNbNodes = aRec.node_labels.size();
if(IsBeam(aRec.fe_descriptor_id)){
anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
aRec.node_labels[1],
case 118: // Solid Quadratic Tetrahedron - TET10
anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[1],
aRec.node_labels[2],
+ aRec.node_labels[1],
aRec.node_labels[3],
aLabel);
break;
break;
case 115: // Solid Linear Brick - HEX8
-
anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
aRec.node_labels[3],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
aRec.node_labels[4],
- aRec.node_labels[5],
- aRec.node_labels[6],
aRec.node_labels[7],
+ aRec.node_labels[6],
+ aRec.node_labels[5],
aLabel);
break;
case 116: // Solid Quadratic Brick - HEX20
anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[4],
aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
aRec.node_labels[12],
- aRec.node_labels[14],
- aRec.node_labels[16],
aRec.node_labels[18],
+ aRec.node_labels[16],
+ aRec.node_labels[14],
aLabel);
break;
}
using namespace std;
+namespace{
+ typedef std::vector<size_t> TConnect;
+
+ int GetConnect(const SMDS_ElemIteratorPtr& theNodesIter,
+ TConnect& theConnect)
+ {
+ theConnect.clear();
+ for(; theNodesIter->more();){
+ const SMDS_MeshElement* anElem = theNodesIter->next();
+ theConnect.push_back(anElem->GetID());
+ }
+ return theConnect.size();
+ }
+
+}
+
Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
{
Status aResult = DRS_OK;
{
using namespace UNV2412;
TDataSet aDataSet2412;
+ TConnect aConnect;
+
// Storing SMDS Edges
MESSAGE("Perform - myMesh->NbEdges() = "<<myMesh->NbEdges());
if(myMesh->NbEdges()){
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
for(; anIter->more();){
const SMDS_MeshEdge* anElem = anIter->next();
- const TElementLab& aLabel = anElem->GetID();
+ TElementLab aLabel = anElem->GetID();
int aNbNodes = anElem->NbNodes();
TRecord aRec;
aRec.node_labels.reserve(aNbNodes);
}
MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
+
MESSAGE("Perform - myMesh->NbFaces() = "<<myMesh->NbFaces());
if(myMesh->NbFaces()){
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more();){
const SMDS_MeshFace* anElem = anIter->next();
- const TElementLab& aLabel = anElem->GetID();
+ TElementLab aLabel = anElem->GetID();
int aNbNodes = anElem->NbNodes();
TRecord aRec;
aRec.node_labels.reserve(aNbNodes);
}
MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
+
MESSAGE("Perform - myMesh->NbVolumes() = "<<myMesh->NbVolumes());
if(myMesh->NbVolumes()){
SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
for(; anIter->more();){
const SMDS_MeshVolume* anElem = anIter->next();
- const TElementLab& aLabel = anElem->GetID();
+ TElementLab aLabel = anElem->GetID();
+
int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.node_labels.reserve(aNbNodes);
+ aConnect.resize(aNbNodes);
+
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
- for(; aNodesIter->more();){
- const SMDS_MeshElement* aNode = aNodesIter->next();
- aRec.node_labels.push_back(aNode->GetID());
- }
+ GetConnect(aNodesIter,aConnect);
+
+ int anId = -1;
+ int* aConn = NULL;
switch(aNbNodes){
- case 4:
- aRec.fe_descriptor_id = 111;
+ case 4: {
+ static int anIds[] = {0,2,1,3};
+ aConn = anIds;
+ anId = 111;
break;
- case 6:
- aRec.fe_descriptor_id = 112;
- swap(aRec.node_labels[1],aRec.node_labels[2]);
- swap(aRec.node_labels[4],aRec.node_labels[5]);
+ }
+ case 6: {
+ static int anIds[] = {0,2,1,3,5,4};
+ aConn = anIds;
+ anId = 112;
break;
- case 8:
- aRec.fe_descriptor_id = 115;
+ }
+ case 8: {
+ static int anIds[] = {0,3,2,1,4,7,6,5};
+ aConn = anIds;
+ anId = 115;
break;
+ }
default:
continue;
}
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ if(aConn){
+ TRecord aRec;
+ aRec.fe_descriptor_id = anId;
+ aRec.node_labels.resize(aNbNodes);
+ for(int aNodeId = 0; aNodeId < aNbNodes; aNodeId++){
+ aRec.node_labels[aConn[aNodeId]] = aConnect[aNodeId];
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
}
MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}