From: eap Date: Thu, 4 May 2006 13:46:01 +0000 (+0000) Subject: Update quadratic elements by the script X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e018834cabb94b08e2fc284e7ce3fb2c4ffc9b61;p=modules%2Fsmesh.git Update quadratic elements by the script --- diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index f6667a1b2..53ccca665 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -63,18 +63,27 @@ static int MYDEBUG = 0; namespace { + //======================================================================= + //function : FindNode + //======================================================================= inline const SMDS_MeshNode* FindNode(const SMDS_Mesh* theMesh, int theId){ if(const SMDS_MeshNode* anElem = theMesh->FindNode(theId)) return anElem; EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<FindElement(theId)) return anElem; EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot find a SMDS_MeshElement for ID = "<AddFaceWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], @@ -132,6 +147,9 @@ namespace } + //======================================================================= + //function : AddQuadsWithID + //======================================================================= inline void AddQuadsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var theSeq, CORBA::Long theId) @@ -139,7 +157,7 @@ namespace const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; if(5*aNbElems != anIndexes.length()) - EXCEPTION(runtime_error,"AddEdgeWithID - 4*aNbElems != anIndexes.length()"); + EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], @@ -152,6 +170,9 @@ namespace } + //======================================================================= + //function : AddPolygonsWithID + //======================================================================= inline void AddPolygonsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, CORBA::Long theId) @@ -176,6 +197,9 @@ namespace } + //======================================================================= + //function : AddTetrasWithID + //======================================================================= inline void AddTetrasWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, CORBA::Long theId) @@ -183,7 +207,7 @@ namespace const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; if(5*aNbElems != anIndexes.length()) - EXCEPTION(runtime_error,"AddEdgeWithID - 5*aNbElems != anIndexes.length()"); + EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], @@ -196,6 +220,9 @@ namespace } + //======================================================================= + //function : AddPiramidsWithID + //======================================================================= inline void AddPiramidsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, CORBA::Long theId) @@ -203,7 +230,7 @@ namespace const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; if(6*aNbElems != anIndexes.length()) - EXCEPTION(runtime_error,"AddEdgeWithID - 6*aNbElems != anIndexes.length()"); + EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], @@ -217,6 +244,9 @@ namespace } + //======================================================================= + //function : AddPrismsWithID + //======================================================================= inline void AddPrismsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, CORBA::Long theId) @@ -224,7 +254,7 @@ namespace const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; if(7*aNbElems != anIndexes.length()) - EXCEPTION(runtime_error,"AddEdgeWithID - 7*aNbElems != anIndexes.length()"); + EXCEPTION(runtime_error,"AddPrismsWithID - 7*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], @@ -239,6 +269,9 @@ namespace } + //======================================================================= + //function : AddHexasWithID + //======================================================================= inline void AddHexasWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, CORBA::Long theId) @@ -246,7 +279,7 @@ namespace const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; if(9*aNbElems != anIndexes.length()) - EXCEPTION(runtime_error,"AddEdgeWithID - 9*aNbElems != anIndexes.length()"); + EXCEPTION(runtime_error,"AddHexasWithID - 9*aNbElems != anIndexes.length()"); for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], @@ -263,6 +296,9 @@ namespace } + //======================================================================= + //function : AddPolyhedronsWithID + //======================================================================= inline void AddPolyhedronsWithID (SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, CORBA::Long theId) @@ -294,6 +330,217 @@ namespace } + //======================================================================= + //function : AddQuadEdgesWithID + //======================================================================= + inline void AddQuadEdgesWithID(SMDS_Mesh* theMesh, + SMESH::log_array_var& theSeq, + CORBA::Long theId) + { + const SMESH::long_array& anIndexes = theSeq[theId].indexes; + CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; + if(4*aNbElems != anIndexes.length()) + EXCEPTION(runtime_error,"AddQuadEdgeWithID - 4*aNbElems != aCoords.length()"); + for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){ + SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<AddFaceWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId+4], + anIndexes[anIndexId+5], + anIndexes[anIndexId+6], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<AddFaceWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId+4], + anIndexes[anIndexId+5], + anIndexes[anIndexId+6], + anIndexes[anIndexId+7], + anIndexes[anIndexId+8], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId+4], + anIndexes[anIndexId+5], + anIndexes[anIndexId+6], + anIndexes[anIndexId+7], + anIndexes[anIndexId+8], + anIndexes[anIndexId+9], + anIndexes[anIndexId+10], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId+4], + anIndexes[anIndexId+5], + anIndexes[anIndexId+6], + anIndexes[anIndexId+7], + anIndexes[anIndexId+8], + anIndexes[anIndexId+9], + anIndexes[anIndexId+10], + anIndexes[anIndexId+11], + anIndexes[anIndexId+12], + anIndexes[anIndexId+13], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId+4], + anIndexes[anIndexId+5], + anIndexes[anIndexId+6], + anIndexes[anIndexId+7], + anIndexes[anIndexId+8], + anIndexes[anIndexId+9], + anIndexes[anIndexId+10], + anIndexes[anIndexId+11], + anIndexes[anIndexId+12], + anIndexes[anIndexId+13], + anIndexes[anIndexId+14], + anIndexes[anIndexId+15], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<AddVolumeWithID(anIndexes[anIndexId+1], + anIndexes[anIndexId+2], + anIndexes[anIndexId+3], + anIndexes[anIndexId+4], + anIndexes[anIndexId+5], + anIndexes[anIndexId+6], + anIndexes[anIndexId+7], + anIndexes[anIndexId+8], + anIndexes[anIndexId+9], + anIndexes[anIndexId+10], + anIndexes[anIndexId+11], + anIndexes[anIndexId+12], + anIndexes[anIndexId+13], + anIndexes[anIndexId+14], + anIndexes[anIndexId+15], + anIndexes[anIndexId+16], + anIndexes[anIndexId+17], + anIndexes[anIndexId+18], + anIndexes[anIndexId+19], + anIndexes[anIndexId+20], + anIndexes[anIndexId]); + if(!anElem) + EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<RemoveNode( FindNode( mySMDSMesh, anIndexes[anElemId] ) );