}
}
+ //=======================================================================
+ //function : AddHexPrismWithID
+ //=======================================================================
+ inline void AddHexPrismWithID(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(13*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddHexPrismWithID - 13*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=13){
+ SMDS_MeshElement* anElem = theMesh->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]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"AddHexPrismWithID - cannot AddVolumeWithID for ID = "<<anElemId);
+ }
+ }
+
//=======================================================================
//function : AddPolyhedronsWithID
}
}
+ //=======================================================================
+ //function : AddBiQuadQuadsWithID
+ //=======================================================================
+ inline void AddBiQuadQuadsWithID(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(10*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddBiQuadQuadsWithID - 10*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=10){
+ SMDS_MeshElement* anElem = theMesh->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+9],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"AddBiQuadQuadsWithID() - cannot AddFaceWithID for ID = "<<anElemId);
+ }
+ }
+
//=======================================================================
//function : AddQuadTetrasWithID
}
}
+ //=======================================================================
+ //function : AddTriQuadHexasWithID
+ //=======================================================================
+ inline void AddTriQuadHexasWithID(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(28*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddTriQuadHexasWithID - 28*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=28){
+ SMDS_MeshElement* anElem = theMesh->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+21],
+ anIndexes[anIndexId+22],
+ anIndexes[anIndexId+23],
+ anIndexes[anIndexId+24],
+ anIndexes[anIndexId+25],
+ anIndexes[anIndexId+26],
+ anIndexes[anIndexId+27],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"AddTriQuadHexasWithID() - cannot AddVolumeWithID for ID = "<<anElemId);
+ }
+ }
+
//=======================================================================
//function : ChangePolyhedronNodes
switch(aCommand)
{
- case SMESH::ADD_NODE : AddNodesWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_ELEM0D : Add0DElementsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_EDGE : AddEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_TRIANGLE : AddTriasWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADRANGLE : AddQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_POLYGON : AddPolygonsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_TETRAHEDRON: AddTetrasWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_PYRAMID : AddPiramidsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_PRISM : AddPrismsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_HEXAHEDRON : AddHexasWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_POLYHEDRON : AddPolyhedronsWithID( mySMDSMesh, aSeq, anId ); break;
-
- case SMESH::ADD_QUADEDGE : AddQuadEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADTRIANGLE : AddQuadTriasWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADQUADRANGLE : AddQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADTETRAHEDRON: AddQuadTetrasWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADPYRAMID : AddQuadPiramidsWithID( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADPENTAHEDRON: AddQuadPentasWithID ( mySMDSMesh, aSeq, anId ); break;
- case SMESH::ADD_QUADHEXAHEDRON : AddQuadHexasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_NODE : AddNodesWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_ELEM0D : Add0DElementsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_EDGE : AddEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_TRIANGLE : AddTriasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADRANGLE : AddQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_POLYGON : AddPolygonsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_TETRAHEDRON : AddTetrasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_PYRAMID : AddPiramidsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_PRISM : AddPrismsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_HEXAHEDRON : AddHexasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_HEXAGONAL_PRISM : AddHexPrismWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_POLYHEDRON : AddPolyhedronsWithID( mySMDSMesh, aSeq, anId ); break;
+
+ case SMESH::ADD_QUADEDGE : AddQuadEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADTRIANGLE : AddQuadTriasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADQUADRANGLE : AddQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_BIQUAD_QUADRANGLE: AddBiQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADTETRAHEDRON : AddQuadTetrasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADPYRAMID : AddQuadPiramidsWithID( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADPENTAHEDRON : AddQuadPentasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADHEXAHEDRON : AddQuadHexasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_TRIQUAD_HEXA : AddTriQuadHexasWithID( mySMDSMesh, aSeq, anId ); break;
case SMESH::CLEAR_MESH:
mySMDSMesh->Clear();
myNumber++;
}
+void SMESHDS_Command::AddVolume(int NewVolID,
+ int idnode1,int idnode2,int idnode3,int idnode4,
+ int idnode5, int idnode6, int idnode7, int idnode8,
+ int idnode9, int idnode10, int idnode11, int idnode12)
+{
+ if (myType != SMESHDS_AddHexagonalPrism)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myIntegers.push_back(idnode6);
+ myIntegers.push_back(idnode7);
+ myIntegers.push_back(idnode8);
+ myIntegers.push_back(idnode9);
+ myIntegers.push_back(idnode10);
+ myIntegers.push_back(idnode11);
+ myIntegers.push_back(idnode12);
+ myNumber++;
+}
+
//=======================================================================
//function : AddPolygonalFace
//purpose :
myNumber++;
}
+//=======================================================================
+//function : AddFace
+//purpose :
+//=======================================================================
+void SMESHDS_Command::AddFace(int NewFaceID,
+ int n1, int n2, int n3, int n4,
+ int n12, int n23, int n34, int n41, int nCenter)
+{
+ if (myType != SMESHDS_AddBiQuadQuadrangle) {
+ MESSAGE("SMESHDS_Command::AddFace : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewFaceID);
+ myIntegers.push_back(n1);
+ myIntegers.push_back(n2);
+ myIntegers.push_back(n3);
+ myIntegers.push_back(n4);
+ myIntegers.push_back(n12);
+ myIntegers.push_back(n23);
+ myIntegers.push_back(n34);
+ myIntegers.push_back(n41);
+ myIntegers.push_back(nCenter);
+ myNumber++;
+}
+
//=======================================================================
//function : AddVolume
//purpose :
myNumber++;
}
+//=======================================================================
+//function : AddVolume
+//purpose :
+//=======================================================================
+void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
+ int n4, int n5, int n6, int n7, int n8,
+ int n12, int n23, int n34, int n41,
+ int n56, int n67, int n78, int n85,
+ int n15, int n26, int n37, int n48,
+ int n1234,int n1256,int n2367,int n3478,
+ int n1458,int n5678,int nCenter)
+{
+ if (!myType == SMESHDS_AddQuadHexahedron) {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(n1);
+ myIntegers.push_back(n2);
+ myIntegers.push_back(n3);
+ myIntegers.push_back(n4);
+ myIntegers.push_back(n5);
+ myIntegers.push_back(n6);
+ myIntegers.push_back(n7);
+ myIntegers.push_back(n8);
+ myIntegers.push_back(n12);
+ myIntegers.push_back(n23);
+ myIntegers.push_back(n34);
+ myIntegers.push_back(n41);
+ myIntegers.push_back(n56);
+ myIntegers.push_back(n67);
+ myIntegers.push_back(n78);
+ myIntegers.push_back(n85);
+ myIntegers.push_back(n15);
+ myIntegers.push_back(n26);
+ myIntegers.push_back(n37);
+ myIntegers.push_back(n48);
+ myIntegers.push_back(n1234);
+ myIntegers.push_back(n1256);
+ myIntegers.push_back(n2367);
+ myIntegers.push_back(n3478);
+ myIntegers.push_back(n1458);
+ myIntegers.push_back(n5678);
+ myIntegers.push_back(nCenter);
+ myNumber++;
+}
+
int idnode4, int idnode5, int idnode6);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
+ int idnode9, int idnode10, int idnode11, int idnode12);
void AddPolygonalFace (const int ElementID,
std::vector<int> nodes_ids);
void AddPolyhedralVolume (const int ElementID,
int n12, int n23, int n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
int n12, int n23, int n34, int n41);
+ void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
+ int n12, int n23, int n34, int n41, int nCenter);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
int n12, int n23, int n31, int n14, int n24, int n34);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5,
int n45, int n56, int n64,
int n14, int n25, int n36);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
+ int n5, int n6, int n7, int n8,
int n12, int n23, int n34, int n41,
int n56, int n67, int n78, int n85,
int n15, int n26, int n37, int n48);
+ void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
+ int n5, int n6, int n7, int n8,
+ int n12, int n23, int n34, int n41,
+ int n56, int n67, int n78, int n85,
+ int n15, int n26, int n37, int n48,
+ int n1234,int n1256,int n2367,int n3478,
+ int n1458,int n5678,int nCenter);
void MoveNode(int NewNodeID, double x, double y, double z);
void RemoveNode(int NodeID);
#ifndef _SMESHDS_CommandType_HeaderFile
#define _SMESHDS_CommandType_HeaderFile
-//#include <Standard_PrimitiveTypes.hxx>
-
enum SMESHDS_CommandType {
SMESHDS_AddNode,
SMESHDS_AddEdge,
SMESHDS_AddQuadPentahedron,
SMESHDS_AddQuadHexahedron,
// special type for 0D elements
- SMESHDS_Add0DElement
+ SMESHDS_Add0DElement,
+ SMESHDS_AddBiQuadQuadrangle,
+ SMESHDS_AddTriQuadHexa,
+ SMESHDS_AddHexagonalPrism
};
return anElem;
}
+
+//=======================================================================
+//function :AddVolume
+//purpose : add hexagonal prism
+//=======================================================================
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
+ int n5, int n6, int n7, int n8,
+ int n9, int n10, int n11, int n12,
+ int ID)
+{
+ SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, ID);
+ if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12);
+ return anElem;
+}
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n9,
+ const SMDS_MeshNode * n10,
+ const SMDS_MeshNode * n11,
+ const SMDS_MeshNode * n12,
+ int ID)
+{
+ return AddVolumeWithID(n1->GetID(),
+ n2->GetID(),
+ n3->GetID(),
+ n4->GetID(),
+ n5->GetID(),
+ n6->GetID(),
+ n7->GetID(),
+ n8->GetID(),
+ n9->GetID(),
+ n10->GetID(),
+ n11->GetID(),
+ n12->GetID(),
+ ID);
+}
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n9,
+ const SMDS_MeshNode * n10,
+ const SMDS_MeshNode * n11,
+ const SMDS_MeshNode * n12)
+{
+ SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12);
+ if(anElem) myScript->AddVolume(anElem->GetID(),
+ n1->GetID(),
+ n2->GetID(),
+ n3->GetID(),
+ n4->GetID(),
+ n5->GetID(),
+ n6->GetID(),
+ n7->GetID(),
+ n8->GetID(),
+ n9->GetID(),
+ n10->GetID(),
+ n11->GetID(),
+ n12->GetID());
+ return anElem;
+}
+
+
//=======================================================================
//function : AddPolygonalFace
//purpose :
}
+//=======================================================================
+//function : AddFace
+//purpose :
+//=======================================================================
+SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * nCenter)
+{
+ SMDS_MeshFace *anElem = SMDS_Mesh::AddFace(n1,n2,n3,n4,n12,n23,n34,n41,nCenter);
+ if(anElem) myScript->AddFace(anElem->GetID(),
+ n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
+ n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
+ nCenter->GetID());
+ return anElem;
+}
+
+//=======================================================================
+//function : AddFaceWithID
+//purpose :
+//=======================================================================
+SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4,
+ int n12,int n23,int n34,int n41,
+ int nCenter, int ID)
+{
+ SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,nCenter,ID);
+ if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41,nCenter);
+ return anElem;
+}
+
+//=======================================================================
+//function : AddFaceWithID
+//purpose :
+//=======================================================================
+SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * nCenter,
+ int ID)
+{
+ return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
+ n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
+ nCenter->GetID(), ID);
+}
+
+
//=======================================================================
//function : AddVolume
//purpose :
//=======================================================================
//function : AddVolume
-//purpose :
+//purpose : add quadratic hexahedron
//=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
ID);
}
+//=======================================================================
+//function : AddVolume
+//purpose : add tri-quadratic hexahedron of 27 nodes
+//=======================================================================
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n56,
+ const SMDS_MeshNode * n67,
+ const SMDS_MeshNode * n78,
+ const SMDS_MeshNode * n85,
+ const SMDS_MeshNode * n15,
+ const SMDS_MeshNode * n26,
+ const SMDS_MeshNode * n37,
+ const SMDS_MeshNode * n48,
+ const SMDS_MeshNode * n1234,
+ const SMDS_MeshNode * n1256,
+ const SMDS_MeshNode * n2367,
+ const SMDS_MeshNode * n3478,
+ const SMDS_MeshNode * n1458,
+ const SMDS_MeshNode * n5678,
+ const SMDS_MeshNode * nCenter)
+{
+ SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n6,n7,n8,
+ n12,n23,n34,n41,
+ n56,n67,n78,n85,
+ n15,n26,n37,n48,
+ n1234,n1256,n2367,n3478,n1458,n5678,nCenter);
+ if(anElem)
+ myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(),
+ n3->GetID(), n4->GetID(), n5->GetID(),
+ n6->GetID(), n7->GetID(), n8->GetID(),
+ n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
+ n56->GetID(), n67->GetID(), n78->GetID(), n85->GetID(),
+ n15->GetID(), n26->GetID(), n37->GetID(), n48->GetID(),
+ n1234->GetID(),n1256->GetID(),n2367->GetID(),n3478->GetID(),
+ n1458->GetID(),n5678->GetID(),nCenter->GetID());
+ return anElem;
+}
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
+ int n5, int n6, int n7, int n8,
+ int n12,int n23,int n34,int n41,
+ int n56,int n67,int n78,int n85,
+ int n15,int n26,int n37,int n48,
+ int n1234,int n1256,int n2367,int n3478,
+ int n1458,int n5678,int nCenter,
+ int ID)
+{
+ SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8,
+ n12,n23,n34,n41,
+ n56,n67,n78,n85,
+ n15,n26,n37,n48,
+ n1234, n1256, n2367, n3478,
+ n1458, n5678, nCenter,
+ ID);
+ if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n6,n7,n8,n12,n23,n34,n41,
+ n56,n67,n78,n85,n15,n26,n37,n48,
+ n1234, n1256, n2367, n3478,
+ n1458, n5678, nCenter);
+ return anElem;
+}
+
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n56,
+ const SMDS_MeshNode * n67,
+ const SMDS_MeshNode * n78,
+ const SMDS_MeshNode * n85,
+ const SMDS_MeshNode * n15,
+ const SMDS_MeshNode * n26,
+ const SMDS_MeshNode * n37,
+ const SMDS_MeshNode * n48,
+ const SMDS_MeshNode * n1234,
+ const SMDS_MeshNode * n1256,
+ const SMDS_MeshNode * n2367,
+ const SMDS_MeshNode * n3478,
+ const SMDS_MeshNode * n1458,
+ const SMDS_MeshNode * n5678,
+ const SMDS_MeshNode * nCenter,
+ int ID)
+{
+ return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
+ n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(),
+ n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
+ n56->GetID(), n67->GetID(), n78->GetID(), n85->GetID(),
+ n15->GetID(), n26->GetID(), n37->GetID(), n48->GetID(),
+ n1234->GetID(),n1256->GetID(),n2367->GetID(),n3478->GetID(),
+ n1458->GetID(),n5678->GetID(),nCenter->GetID(), ID);
+}
+
void SMESHDS_Mesh::compactMesh()
{
int newNodeSize = 0;
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12);
-
+ // tria 3
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3);
-
+ // quad 4
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41);
+ // bi-quadratic quadrangle of 9 nodes
+ virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
+ int n12,int n23,int n34,int n41, int nCenter, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * nCenter,
+ int ID);
+ virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * nCenter);
+ // tetra 4
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
-
+ // pyra 5
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5);
-
+ // penta 6
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6);
-
+ // hexa 8
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8);
-
+ // hexagonal prism of 12 nodes
+ virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6,
+ int n7, int n8, int n9, int n10, int n11, int n12, int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n9,
+ const SMDS_MeshNode * n10,
+ const SMDS_MeshNode * n11,
+ const SMDS_MeshNode * n12,
+ int ID);
+ virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n9,
+ const SMDS_MeshNode * n10,
+ const SMDS_MeshNode * n11,
+ const SMDS_MeshNode * n12);
+
// 2d order tetrahedron of 10 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n31,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48);
+ // 2d order Hexahedrons with 27 nodes
+ virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
+ int n5, int n6, int n7, int n8,
+ int n12,int n23,int n34,int n41,
+ int n56,int n67,int n78,int n85,
+ int n15,int n26,int n37,int n48,
+ int n1234,int n1256,int n2367,int n3478,
+ int n1458,int n5678,int nCenter,
+ int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n56,
+ const SMDS_MeshNode * n67,
+ const SMDS_MeshNode * n78,
+ const SMDS_MeshNode * n85,
+ const SMDS_MeshNode * n15,
+ const SMDS_MeshNode * n26,
+ const SMDS_MeshNode * n37,
+ const SMDS_MeshNode * n48,
+ const SMDS_MeshNode * n1234,
+ const SMDS_MeshNode * n1256,
+ const SMDS_MeshNode * n2367,
+ const SMDS_MeshNode * n3478,
+ const SMDS_MeshNode * n1458,
+ const SMDS_MeshNode * n5678,
+ const SMDS_MeshNode * nCenter,
+ int ID);
+ virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n56,
+ const SMDS_MeshNode * n67,
+ const SMDS_MeshNode * n78,
+ const SMDS_MeshNode * n85,
+ const SMDS_MeshNode * n15,
+ const SMDS_MeshNode * n26,
+ const SMDS_MeshNode * n37,
+ const SMDS_MeshNode * n48,
+ const SMDS_MeshNode * n1234,
+ const SMDS_MeshNode * n1256,
+ const SMDS_MeshNode * n2367,
+ const SMDS_MeshNode * n3478,
+ const SMDS_MeshNode * n1458,
+ const SMDS_MeshNode * n5678,
+ const SMDS_MeshNode * nCenter);
+
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<int>& nodes_ids,
const int ID);
idnode5, idnode6, idnode7, idnode8);
}
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
+ int idnode9, int idnode10, int idnode11, int idnode12)
+{
+ if(myIsEmbeddedMode){
+ myIsModified = true;
+ return;
+ }
+ getCommand(SMESHDS_AddHexagonalPrism)->AddVolume(NewVolID,
+ idnode1, idnode2, idnode3, idnode4,
+ idnode5, idnode6, idnode7, idnode8,
+ idnode9, idnode10, idnode11, idnode12);
+}
+
//=======================================================================
//function : AddPolygonalFace
//purpose :
n12, n23, n34, n41);
}
+//=======================================================================
+//function : AddFace
+//purpose :
+//=======================================================================
+void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
+ int n12, int n23, int n34, int n41, int nCenter)
+{
+ if(myIsEmbeddedMode){
+ myIsModified = true;
+ return;
+ }
+ getCommand(SMESHDS_AddBiQuadQuadrangle)->AddFace(NewFaceID, n1, n2, n3, n4,
+ n12, n23, n34, n41, nCenter);
+}
+
//=======================================================================
//function : AddVolume
//purpose :
n15, n26, n37, n48);
}
+//=======================================================================
+//function : AddVolume
+//purpose :
+//=======================================================================
+void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3,
+ int n4, int n5, int n6, int n7, int n8,
+ int n12, int n23, int n34, int n41,
+ int n56, int n67, int n78, int n85,
+ int n15, int n26, int n37, int n48,
+ int n1234,int n1256,int n2367,int n3478,
+ int n1458,int n5678,int nCenter)
+{
+ if(myIsEmbeddedMode){
+ myIsModified = true;
+ return;
+ }
+ getCommand(SMESHDS_AddTriQuadHexa)->AddVolume(NewVolID, n1, n2, n3, n4,
+ n5, n6, n7, n8,
+ n12, n23, n34, n41,
+ n56, n67, n78, n85,
+ n15, n26, n37, n48,
+ n1234, n1256, n2367, n3478,
+ n1458, n5678, nCenter);
+}
+
int idnode4, int idnode5, int idnode6);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
+ int idnode9, int idnode10, int idnode11, int idnode12);
void AddPolygonalFace (const int NewFaceID,
std::vector<int> nodes_ids);
int n12, int n23, int n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
int n12, int n23, int n34, int n41);
+ void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
+ int n12, int n23, int n34, int n41, int nCenter);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
int n12, int n23, int n31, int n14, int n24, int n34);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5,
int n12, int n23, int n34, int n41,
int n56, int n67, int n78, int n85,
int n15, int n26, int n37, int n48);
- void MoveNode(int NewNodeID, double x, double y, double z);
+ void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
+ int n5, int n6, int n7, int n8,
+ int n12, int n23, int n34, int n41,
+ int n56, int n67, int n78, int n85,
+ int n15, int n26, int n37, int n48,
+ int n1234,int n1256,int n2367,int n3478,
+ int n1458,int n5678,int nCenter);
+ void MoveNode(int NewNodeID, double x, double y, double z);
void RemoveNode(int NodeID);
void RemoveElement(int ElementID);
void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);