534 |
void plot2(const SurfaceMeshOfTriangles& s, |
void plot2(const SurfaceMeshOfTriangles& s, |
535 |
std::set<const Cell*>& hlist, |
std::set<const Cell*>& hlist, |
536 |
Structured3DMesh& SMesh); |
Structured3DMesh& SMesh); |
537 |
void plotmedit(const SurfaceMeshOfTriangles& s_mesh,std::set<const Cell*>& toTreatHexahedra,size_t nobj); |
void plotmedit(const SurfaceMeshOfTriangles& s_mesh,std::set<const Cell*>& toTreatHexahedra,size_t nobj,size_t nobjother); |
538 |
void Bary(Vertex& P,TinyVector<3>& P0,TinyVector<3>& V12,TinyVector<3>& V02); |
void Bary(Vertex& P,TinyVector<3>& P0,TinyVector<3>& V12,TinyVector<3>& V02,size_t& ncompt); |
539 |
|
|
540 |
|
|
541 |
|
|
588 |
otherReferences.erase(O.reference()); |
otherReferences.erase(O.reference()); |
589 |
size_t nobject = scene.nbObjects(); |
size_t nobject = scene.nbObjects(); |
590 |
std::cout<<"nb object "<<nobject<<"\n"; |
std::cout<<"nb object "<<nobject<<"\n"; |
591 |
(*__internals).verticesListes.resize(nobject); |
(*__internals).verticesListes.resize(nobject+1); |
592 |
(*__internals).triangleListes.resize(nobject); |
(*__internals).triangleListes.resize(nobject+1); |
593 |
|
|
594 |
for(int no=0 ; no<nobject ; ++no) |
for(int no=0 ; no<nobject+1 ; ++no) |
595 |
{ |
{ |
596 |
(*__internals).triangleListes[no]= new SurfaceMeshGenerator::Internals::EdgePairList; |
(*__internals).triangleListes[no]= new SurfaceMeshGenerator::Internals::EdgePairList; |
597 |
(*__internals).verticesListes[no]= new SurfaceMeshGenerator::Internals::VerticesList; |
(*__internals).verticesListes[no]= new SurfaceMeshGenerator::Internals::VerticesList; |
925 |
} |
} |
926 |
|
|
927 |
// (*(*__internals).triangleListes[0]).clear(); |
// (*(*__internals).triangleListes[0]).clear(); |
928 |
// (*(*__internals).verticesListes[0]).clear(); |
// (*(*__internals).verticesListes[0]).clear(); |
|
|
|
929 |
|
|
930 |
// (*__internals).__createTriangles(S, ref,0); |
// (*__internals).__createTriangles(S, ref,0); |
931 |
|
|
932 |
// size_t nobj= (*(*__internals).triangleListes[0]).size(); |
// size_t nobj= (*(*__internals).triangleListes[0]).size(); |
933 |
//std::cout<<"nb tr objet1 "<<nobj<<" \n"; |
//std::cout<<"nb tr objet1 "<<nobj<<" \n"; |
934 |
|
//std::cout<<(*(*__internals).verticesListes[0]).size()<<"\n"; |
935 |
|
|
936 |
// size_t num=0; |
// size_t num=0; |
937 |
// for(ObjectReferences::iterator i = otherReferences.begin(); |
// for(ObjectReferences::iterator i = otherReferences.begin(); |
938 |
// i != otherReferences.end(); ++i) { |
// i != otherReferences.end(); ++i) { |
939 |
// num+=1; |
// num+=1; |
940 |
// for(size_t n = 0; n<scene.nbObjects(); ++n) { |
// for(size_t n = 0; n<scene.nbObjects(); ++n) { |
941 |
// Reference::Representation otherRef; |
// Reference::Representation otherRef; |
942 |
// otherRef.resize(scene.nbObjects()); |
// otherRef.resize(scene.nbObjects()); |
943 |
// |
// |
944 |
// if (scene.object(n).reference() == ((*i).first)) { |
// if (scene.object(n).reference() == ((*i).first)) { |
945 |
// otherRef[n] = true; |
// otherRef[n] = true; |
946 |
// (*__internals).__createTriangles(*(scene.object(n).shape()), |
// (*__internals).__createTriangles(*(scene.object(n).shape()), |
947 |
// otherRef,num); |
// otherRef,num); |
949 |
// } |
// } |
950 |
// } |
// } |
951 |
|
|
952 |
// std::cout<<"nb tr objet2 "<<(*(*__internals).verticesListes[1]).size()<<" \n"; |
// size_t nobjother=(*(*__internals).triangleListes[1]).size(); |
953 |
// size_t nobjother=(*(*__internals).triangleListes[1]).size(); |
//std::cout<<"nb tr objet2 "<<nobjother<<" \n"; |
954 |
|
//std::cout<<(*(*__internals).verticesListes[1]).size()<<"\n"; |
955 |
|
|
|
size_t ntr=0; |
|
|
for(size_t n = 0; n<scene.nbObjects(); ++n) |
|
|
ntr+=(*(*__internals).verticesListes[n]).size(); |
|
956 |
|
|
957 |
s_mesh.setNumberOfVertices(ntr); |
// std::set<const Cell*> toTreatHexahedra; |
958 |
|
// std::set_difference (cuttedHexahedra.begin(), cuttedHexahedra.end(), |
959 |
//! copies vertices into the s_mesh. |
// meshedHexahedra.begin(), meshedHexahedra.end(), |
960 |
int i = 0; |
// inserter(toTreatHexahedra, toTreatHexahedra.begin())); |
|
for(size_t n = 0; n<scene.nbObjects(); ++n) |
|
|
{ |
|
|
for(SurfaceMeshGenerator::Internals::VerticesList::iterator splitVertex |
|
|
= (*(*__internals).verticesListes[n]).begin(); |
|
|
splitVertex != (*(*__internals).verticesListes[n]).end(); ++splitVertex) |
|
|
{ |
|
|
s_mesh.vertex(i) = (*(*splitVertex).second); |
|
|
delete (*splitVertex).second; |
|
|
(*splitVertex).second = &s_mesh.vertex(i); |
|
|
i++; |
|
|
} |
|
|
} |
|
961 |
|
|
962 |
|
//******************************************************************************* |
963 |
|
/* std::vector<Vertex*> vertexintersectionList; |
964 |
|
std::list<int> numberOfIntersectionPerTriangle; |
965 |
|
|
966 |
//std::set<const Cell*> toTreatHexahedra; |
for(SurfaceMeshGenerator::Internals::EdgePairList::iterator currentTriangle |
|
//std::set_difference (cuttedHexahedra.begin(), cuttedHexahedra.end(), |
|
|
// meshedHexahedra.begin(), meshedHexahedra.end(), |
|
|
// inserter(toTreatHexahedra, toTreatHexahedra.begin())); |
|
|
//******************************************************************************* |
|
|
/* for(SurfaceMeshGenerator::Internals::EdgePairList::iterator currentTriangle |
|
967 |
= (*(*__internals).triangleListes[0]).begin(); |
= (*(*__internals).triangleListes[0]).begin(); |
968 |
currentTriangle != (*(*__internals).triangleListes[0]).end(); |
currentTriangle != (*(*__internals).triangleListes[0]).end(); |
969 |
++currentTriangle) |
++currentTriangle) |
970 |
{ |
{ |
971 |
|
size_t numInter=0; |
972 |
Vertex& V0 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[0]]); |
Vertex& V0 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[0]]); |
973 |
Vertex& V1 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[1]]); |
Vertex& V1 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[1]]); |
974 |
Vertex& V2 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[2]]); |
Vertex& V2 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[2]]); |
982 |
coeff=V01^V02; |
coeff=V01^V02; |
983 |
|
|
984 |
real_t d=-(coeff[0]*V0[0]+coeff[1]*V0[1]+coeff[2]*V0[2]); |
real_t d=-(coeff[0]*V0[0]+coeff[1]*V0[1]+coeff[2]*V0[2]); |
985 |
std::cout<<"--------------------------------------------------------------\n"; |
// std::cout<<"--------------------------------------------------------------\n"; |
986 |
for(SurfaceMeshGenerator::Internals::EdgePairList::iterator currentTriangle |
for(SurfaceMeshGenerator::Internals::EdgePairList::iterator currentTriangle |
987 |
= (*(*__internals).triangleListes[1]).begin(); |
= (*(*__internals).triangleListes[1]).begin(); |
988 |
currentTriangle != (*(*__internals).triangleListes[1]).end(); |
currentTriangle != (*(*__internals).triangleListes[1]).end(); |
995 |
|
|
996 |
|
|
997 |
real_t pscalar,k; |
real_t pscalar,k; |
998 |
|
size_t num; |
999 |
{ |
{ |
1000 |
Vertex P; |
Vertex P; |
1001 |
TinyVector<3> Vo01; |
TinyVector<3> Vo01; |
1007 |
P=Vo0+k*Vo01; |
P=Vo0+k*Vo01; |
1008 |
TinyVector<3> P0=P.Vector3()-V2.Vector3(); |
TinyVector<3> P0=P.Vector3()-V2.Vector3(); |
1009 |
//std::cout<<"verif "<<coeff[0]*P.Vector3()[0]+coeff[1]*P.Vector3()[1]+coeff[2]*P.Vector3()[2]+d<<"\n"; |
//std::cout<<"verif "<<coeff[0]*P.Vector3()[0]+coeff[1]*P.Vector3()[1]+coeff[2]*P.Vector3()[2]+d<<"\n"; |
1010 |
Bary(P,P0,V12,V02); |
Bary(P,P0,V12,V02,num); |
1011 |
|
if(num==3) |
1012 |
|
{ |
1013 |
|
std::cout<<P.Vector3()[0]<<" "<<P.Vector3()[1]<<" "<<P.Vector3()[2]<<" 3 point intersection \n"; |
1014 |
|
vertexintersectionList.push_back(&P); |
1015 |
|
|
1016 |
|
numInter+=1; |
1017 |
|
} |
1018 |
} |
} |
1019 |
} |
} |
1020 |
{ |
{ |
1028 |
k=-(coeff[0]*Vo0[0]+coeff[1]*Vo0[1]+coeff[2]*Vo0[2]+d)/pscalar; |
k=-(coeff[0]*Vo0[0]+coeff[1]*Vo0[1]+coeff[2]*Vo0[2]+d)/pscalar; |
1029 |
P=Vo0+k*Vo02; |
P=Vo0+k*Vo02; |
1030 |
TinyVector<3> P0=P.Vector3()-V2.Vector3(); |
TinyVector<3> P0=P.Vector3()-V2.Vector3(); |
1031 |
Bary(P,P0,V12,V02); |
Bary(P,P0,V12,V02,num); |
1032 |
|
if(num==3) |
1033 |
|
{std::cout<<P.Vector3()[0]<<" "<<P.Vector3()[1]<<" "<<P.Vector3()[2]<<" 3 point intersection \n"; |
1034 |
|
vertexintersectionList.push_back(&P); |
1035 |
|
numInter+=1; |
1036 |
|
} |
1037 |
} |
} |
1038 |
} |
} |
1039 |
{ |
{ |
1047 |
Vertex P; |
Vertex P; |
1048 |
P=Vo1+k*Vo12; |
P=Vo1+k*Vo12; |
1049 |
TinyVector<3> P0=P.Vector3()-V2.Vector3(); |
TinyVector<3> P0=P.Vector3()-V2.Vector3(); |
1050 |
Bary(P,P0,V12,V02); |
Bary(P,P0,V12,V02,num); |
1051 |
|
if(num==3) |
1052 |
|
{std::cout<<P.Vector3()[0]<<" "<<P.Vector3()[1]<<" "<<P.Vector3()[2]<<" 3 point intersection \n"; |
1053 |
|
vertexintersectionList.push_back(&P); |
1054 |
|
numInter+=1; |
1055 |
|
} |
1056 |
} |
} |
1057 |
} |
} |
1058 |
} |
} |
1059 |
}*/ |
numberOfIntersectionPerTriangle.push_back(numInter); |
1060 |
|
//std::cout<<"nb inter "<<numInter<<"\n"; |
1061 |
|
} |
1062 |
|
// create triangles |
1063 |
|
int mark = 0; |
1064 |
|
std::list<int>::iterator nbInter=numberOfIntersectionPerTriangle.begin(); |
1065 |
|
size_t nbVertexInter=vertexintersectionList.size(); |
1066 |
|
std::vector<Vertex*> vertexplot; |
1067 |
|
|
1068 |
|
for(SurfaceMeshGenerator::Internals::EdgePairList::const_iterator currentTriangle |
1069 |
|
= (*(*__internals).triangleListes[0]).begin(); |
1070 |
|
currentTriangle != (*(*__internals).triangleListes[0]).end(); |
1071 |
|
++currentTriangle) |
1072 |
|
{ |
1073 |
|
//if the triangle is intersected |
1074 |
|
if(*nbInter!=0) |
1075 |
|
{ |
1076 |
|
Vertex& V0 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[0]]); |
1077 |
|
Vertex& V1 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[1]]); |
1078 |
|
Vertex& V2 = *((*(*__internals).verticesListes[0])[(*currentTriangle)[2]]); |
1079 |
|
if(V0.Ref().insideDomain() or V1.Ref().insideDomain() or V2.Ref().insideDomain()) |
1080 |
|
{ |
1081 |
|
Vertex& A=V0; |
1082 |
|
if(V1.Ref().insideDomain()) |
1083 |
|
A=V1; |
1084 |
|
else |
1085 |
|
if(V2.Ref().insideDomain()) |
1086 |
|
A=V2; |
1087 |
|
for(int k=0 ; k<*nbInter ; ++k) |
1088 |
|
{ |
1089 |
|
Vertex& B=(*(vertexintersectionList[k+mark])); |
1090 |
|
Vertex& C=(*(vertexintersectionList[k+1+mark])); |
1091 |
|
if(k==*nbInter-1 and k+mark==nbVertexInter) |
1092 |
|
C=(*(vertexintersectionList[0])); |
1093 |
|
// Edge e0=Edge(A,B),e1=Edge(A,C),e2=Edge(B,C); |
1094 |
|
// (*(*__internals).triangleListes[2]).push_front(TinyVector<3,Edge::Pair>()); |
1095 |
|
// SurfaceMeshGenerator::Internals::EdgePairList::iterator current |
1096 |
|
// = (*(*__internals).triangleListes[2]).begin(); |
1097 |
|
// (*current)[0]=(Edge::Pair)(e0); |
1098 |
|
//(*current)[1]=(Edge::Pair)(e1); |
1099 |
|
//(*current)[2]=(Edge::Pair)(e2); |
1100 |
|
//(*(*__internals).verticesListes[2])[e0]=new Vertex(e0(0)); |
1101 |
|
//(*(*__internals).verticesListes[2])[e1]=new Vertex(e1(0)); |
1102 |
|
//(*(*__internals).verticesListes[2])[e2]=new Vertex(e2(0)); |
1103 |
|
vertexplot.push_back(&A); |
1104 |
|
vertexplot.push_back(&B); |
1105 |
|
vertexplot.push_back(&C); |
1106 |
|
//std::cout<<"1 "<<C.Vector3()[0]<<" "<<C.Vector3()[1]<<" "<<C.Vector3()[2]<<"\n"; |
1107 |
|
|
1108 |
|
} |
1109 |
|
} |
1110 |
|
|
1111 |
|
else |
1112 |
|
{ |
1113 |
|
Vertex& A=V0; |
1114 |
|
Vertex& B=V1; |
1115 |
|
if(!(V1.Ref().insideDomain())) |
1116 |
|
B=V2; |
1117 |
|
else |
1118 |
|
if(!(V0.Ref().insideDomain())) |
1119 |
|
A=V2; |
1120 |
|
for(int k=0 ; k<*nbInter ; ++k) |
1121 |
|
{ |
1122 |
|
Vertex& C=(*(vertexintersectionList[k+mark])); |
1123 |
|
//Edge e0=Edge(A,B),e1=Edge(A,C),e2=Edge(B,C); |
1124 |
|
//(*(*__internals).triangleListes[2]).push_front(TinyVector<3,Edge::Pair>()); |
1125 |
|
//SurfaceMeshGenerator::Internals::EdgePairList::iterator current |
1126 |
|
//= (*(*__internals).triangleListes[2]).begin(); |
1127 |
|
//(*current)[0]=(Edge::Pair)(e0); |
1128 |
|
//(*current)[1]=(Edge::Pair)(e1); |
1129 |
|
//(*current)[2]=(Edge::Pair)(e2); |
1130 |
|
//(*(*__internals).verticesListes[2])[e0]=new Vertex(e0(0)); |
1131 |
|
//(*(*__internals).verticesListes[2])[e1]=new Vertex(e1(0)); |
1132 |
|
//(*(*__internals).verticesListes[2])[e2]=new Vertex(e2(0)); |
1133 |
|
vertexplot.push_back(&A); |
1134 |
|
vertexplot.push_back(&B); |
1135 |
|
vertexplot.push_back(&C); |
1136 |
|
//std::cout<<"2 "<<k<<" "<<mark<<" "<<C.Vector3()[0]<<" "<<C.Vector3()[1]<<" "<<C.Vector3()[2]<<"\n"; |
1137 |
|
|
1138 |
|
} |
1139 |
|
} |
1140 |
|
} |
1141 |
|
mark+=*nbInter; |
1142 |
|
++nbInter; |
1143 |
|
|
1144 |
|
} |
1145 |
|
|
1146 |
|
std::cout<<(*(*__internals).verticesListes[2]).size()<<"\n"; |
1147 |
|
std::cout<<(*(*__internals).triangleListes[2]).size()<<"\n"; |
1148 |
|
std::cout<<(*(*__internals).verticesListes[0]).size()<<"\n"; |
1149 |
|
std::cout<<(*(*__internals).triangleListes[0]).size()<<"\n"; |
1150 |
|
*/ |
1151 |
|
size_t ntr=0; |
1152 |
|
for(size_t n = 0; n<scene.nbObjects()+1; ++n) |
1153 |
|
ntr+=(*(*__internals).verticesListes[n]).size(); |
1154 |
|
|
1155 |
|
s_mesh.setNumberOfVertices(ntr); |
1156 |
|
|
1157 |
|
//! copies vertices into the s_mesh. |
1158 |
|
int i = 0; |
1159 |
|
for(size_t n = 0; n<scene.nbObjects()+1; ++n) |
1160 |
|
{ |
1161 |
|
for(SurfaceMeshGenerator::Internals::VerticesList::iterator splitVertex |
1162 |
|
= (*(*__internals).verticesListes[n]).begin(); |
1163 |
|
splitVertex != (*(*__internals).verticesListes[n]).end(); ++splitVertex) |
1164 |
|
{ |
1165 |
|
s_mesh.vertex(i) = (*(*splitVertex).second); |
1166 |
|
delete (*splitVertex).second; |
1167 |
|
(*splitVertex).second = &s_mesh.vertex(i); |
1168 |
|
i++; |
1169 |
|
} |
1170 |
|
} |
1171 |
|
|
1172 |
|
|
1173 |
i = 0; |
i = 0; |
1174 |
size_t ncell=0; |
size_t ncell=0; |
1175 |
for(size_t n = 0; n<scene.nbObjects(); ++n) |
for(size_t n = 0; n<scene.nbObjects()+1; ++n) |
1176 |
ncell+=(*(*__internals).triangleListes[n]).size(); |
ncell+=(*(*__internals).triangleListes[n]).size(); |
1177 |
|
|
1178 |
s_mesh.setNumberOfCells(ncell); |
s_mesh.setNumberOfCells(ncell); |
1179 |
|
|
1180 |
SurfaceMeshGenerator::Internals::MotherCellList::iterator motherCell |
SurfaceMeshGenerator::Internals::MotherCellList::iterator motherCell |
1181 |
= (*__internals).cellList.begin(); |
= (*__internals).cellList.begin(); |
1182 |
|
|
1183 |
for(size_t n = 0; n<scene.nbObjects(); ++n) |
for(size_t n = 0; n<scene.nbObjects()+1; ++n) |
1184 |
{ |
{ |
1185 |
for(SurfaceMeshGenerator::Internals::EdgePairList::iterator currentTriangle |
for(SurfaceMeshGenerator::Internals::EdgePairList::iterator currentTriangle |
1186 |
= (*(*__internals).triangleListes[n]).begin(); |
= (*(*__internals).triangleListes[n]).begin(); |
1199 |
motherCell++; |
motherCell++; |
1200 |
} |
} |
1201 |
} |
} |
1202 |
|
/*std::cout<<nobjother<<" plot medit\n"; |
1203 |
|
|
1204 |
|
{ |
1205 |
|
std::ofstream sortie("plot.mesh"); |
1206 |
|
|
1207 |
// plotmedit(s_mesh,toTreatHexahedra,nobj); |
sortie<<"MeshVersionFormatted 1"<<" \n"; |
1208 |
|
sortie<<" \n"; |
1209 |
|
sortie<<"Dimension"<<" \n"; |
1210 |
|
sortie<<"3"<<" \n"; |
1211 |
|
sortie<<" \n"; |
1212 |
|
sortie<<"Vertices"<<" \n"; |
1213 |
|
sortie<<vertexplot.size()<<"\n"; |
1214 |
|
for(int i=0;i<vertexplot.size();++i) |
1215 |
|
{ |
1216 |
|
sortie<<(*vertexplot[i]).Vector3()[0]<<" "<<(*vertexplot[i]).Vector3()[1]<<" "<<(*vertexplot[i]).Vector3()[2]<<" 0"<<" \n"; |
1217 |
|
} |
1218 |
|
|
1219 |
|
sortie<<" \n"; |
1220 |
|
sortie<<"Triangles"<<"\n"; |
1221 |
|
sortie<<vertexplot.size()/3<<"\n"; |
1222 |
|
|
1223 |
|
for (size_t i=0; i<vertexplot.size()/3; ++i) |
1224 |
|
{ |
1225 |
|
sortie<<3*i+1<<" "<<3*i+2<<" "<<3*i+3<<" "<<1<<"\n"; |
1226 |
|
} |
1227 |
|
sortie<<" \n"; |
1228 |
|
sortie<<"End"<<"\n"; |
1229 |
|
}*/ |
1230 |
|
|
1231 |
|
// plotmedit(s_mesh,toTreatHexahedra,nobj,nobjother); |
1232 |
// plot2(s_mesh, toTreatHexahedra, SMesh); |
// plot2(s_mesh, toTreatHexahedra, SMesh); |
1233 |
} |
} |
1234 |
|
|
1246 |
} |
} |
1247 |
|
|
1248 |
|
|
1249 |
void Bary(Vertex& P,TinyVector<3>& P0,TinyVector<3>& V12,TinyVector<3>& V02) |
void Bary(Vertex& P,TinyVector<3>& P0,TinyVector<3>& V12,TinyVector<3>& V02,size_t& compt) |
1250 |
{ |
{ |
1251 |
TinyMatrix<2,2> mat; |
TinyMatrix<2,2> mat; |
1252 |
real_t det=V02[0]*V12[1]-V02[1]*V12[0]; |
real_t det=V02[0]*V12[1]-V02[1]*V12[0]; |
1253 |
size_t compt=0; |
compt=0; |
1254 |
real_t eps=-1e-10; |
real_t eps=-1e-10; |
1255 |
if(det!=0.) |
if(det!=0.) |
1256 |
{ |
{ |
1309 |
compt+=1; |
compt+=1; |
1310 |
} |
} |
1311 |
} |
} |
1312 |
if(compt==3) |
// if(compt==3) |
1313 |
std::cout<<P.Vector3()[0]<<" "<<P.Vector3()[1]<<" "<<P.Vector3()[2]<<" 3 point intersection \n"; |
// { |
1314 |
|
//std::cout<<P.Vector3()[0]<<" "<<P.Vector3()[1]<<" "<<P.Vector3()[2]<<" 3 point intersection \n"; |
1315 |
|
// } |
1316 |
} |
} |
1317 |
|
|
1318 |
|
|
1319 |
void plotmedit(const SurfaceMeshOfTriangles& s_mesh,std::set<const Cell*>& toTreatHexahedra,size_t nobj) |
void plotmedit(const SurfaceMeshOfTriangles& s_mesh,std::set<const Cell*>& toTreatHexahedra,size_t nobj,size_t nobjother) |
1320 |
{ |
{ |
1321 |
|
|
1322 |
//********************************************************************** |
//********************************************************************** |
1333 |
sortie<<8*toTreatHexahedra.size()+s_mesh.numberOfVertices()<<" \n"; |
sortie<<8*toTreatHexahedra.size()+s_mesh.numberOfVertices()<<" \n"; |
1334 |
for (std::set<const Cell*>::iterator i = toTreatHexahedra.begin(); |
for (std::set<const Cell*>::iterator i = toTreatHexahedra.begin(); |
1335 |
i != toTreatHexahedra.end(); ++i) |
i != toTreatHexahedra.end(); ++i) |
1336 |
{ |
{ |
1337 |
const CartesianHexahedron& H = static_cast<const CartesianHexahedron&>(*(*i)); |
const CartesianHexahedron& H = static_cast<const CartesianHexahedron&>(*(*i)); |
1338 |
for (size_t j=0; j<8; ++j) |
for (size_t j=0; j<8; ++j) |
1339 |
{ |
{ |
1340 |
sortie<<H(j)[0]<<" "<<H(j)[1]<<" "<<H(j)[2]<<" 0"<<" \n"; |
sortie<<H(j)[0]<<" "<<H(j)[1]<<" "<<H(j)[2]<<" 0"<<" \n"; |
1341 |
} |
} |
1342 |
} |
} |
1343 |
for(int i=0;i<s_mesh.numberOfVertices();++i) |
for(int i=0;i<s_mesh.numberOfVertices();++i) |
1344 |
{ |
{ |
1345 |
sortie<<s_mesh.vertex(i)[0]<<" "<<s_mesh.vertex(i)[1]<<" "<<s_mesh.vertex(i)[2]<<" 0"<<" \n"; |
sortie<<s_mesh.vertex(i)[0]<<" "<<s_mesh.vertex(i)[1]<<" "<<s_mesh.vertex(i)[2]<<" 0"<<" \n"; |
1346 |
} |
} |
|
|
|
1347 |
// for (size_t i=0; i<s_mesh.numberOfCells(); ++i) |
// for (size_t i=0; i<s_mesh.numberOfCells(); ++i) |
1348 |
// { |
// { |
1349 |
// const Triangle& T = s_mesh.cell(i); |
// const Triangle& T = s_mesh.cell(i); |
1360 |
{ |
{ |
1361 |
const Triangle& T = s_mesh.cell(i); |
const Triangle& T = s_mesh.cell(i); |
1362 |
sortie<<s_mesh.vertexNumber(T(0))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(1))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(2))+8*toTreatHexahedra.size()+1; |
sortie<<s_mesh.vertexNumber(T(0))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(1))+8*toTreatHexahedra.size()+1<<" "<<s_mesh.vertexNumber(T(2))+8*toTreatHexahedra.size()+1; |
1363 |
// sortie<<3*i+1+8*toTreatHexahedra.size()<<" "<<3*i+2+8*toTreatHexahedra.size()<<" "<<3*i+3+8*toTreatHexahedra.size(); |
// sortie<<3*i+1+8*toTreatHexahedra.size()<<" "<<3*i+2+8*toTreatHexahedra.size()<<" //"<<3*i+3+8*toTreatHexahedra.size()<<" "<<1<<"\n"; |
1364 |
if(i<(nobj)) |
if(i<(nobj)) |
1365 |
sortie<<" 1"<<"\n"; |
sortie<<" 1"<<"\n"; |
1366 |
else |
else |
1367 |
sortie<<" 2"<<"\n"; |
if(i<(nobj+nobjother)) |
1368 |
|
sortie<<" 2"<<"\n"; |
1369 |
|
else |
1370 |
|
sortie<<" 3"<<"\n"; |
1371 |
} |
} |
1372 |
sortie<<" \n"; |
sortie<<" \n"; |
1373 |
sortie<<"Hexahedra"<<"\n"; |
sortie<<"Hexahedra"<<"\n"; |
1381 |
sortie<<SMesh.vertexNumber(H(j))<<" \n"; |
sortie<<SMesh.vertexNumber(H(j))<<" \n"; |
1382 |
}*/ |
}*/ |
1383 |
for(int i=0;i<toTreatHexahedra.size();i++) |
for(int i=0;i<toTreatHexahedra.size();i++) |
1384 |
sortie<<8*i+1<<" "<<8*i+2<<" "<<8*i+3<<" "<<8*i+4<<" "<<8*i+5<<" "<<8*i+6<<" "<<8*i+7<<" "<<8*i+8<<" 2"<<"\n"; |
sortie<<8*i+1<<" "<<8*i+2<<" "<<8*i+3<<" "<<8*i+4<<" "<<8*i+5<<" "<<8*i+6<<" "<<8*i+7<<" "<<8*i+8<<" 3"<<"\n"; |
1385 |
sortie<<"End"<<" \n"; |
sortie<<"End"<<" \n"; |
1386 |
|
|
1387 |
} |
} |