38 |
#include <MeshTetrahedrizor.hpp> |
#include <MeshTetrahedrizor.hpp> |
39 |
#include <MeshSimplifier.hpp> |
#include <MeshSimplifier.hpp> |
40 |
#include <MeshReader.hpp> |
#include <MeshReader.hpp> |
41 |
|
#include <MeshExtractor.hpp> |
42 |
|
|
43 |
#include <SurfaceMeshGenerator.hpp> |
#include <SurfaceMeshGenerator.hpp> |
44 |
|
|
45 |
ReferenceCounting<Mesh> MeshExpression::mesh() const |
ReferenceCounting<Mesh> MeshExpression::mesh() const |
148 |
|
|
149 |
Structured3DMesh& SMesh |
Structured3DMesh& SMesh |
150 |
= dynamic_cast<Structured3DMesh&>(*(*__smesh).mesh()); |
= dynamic_cast<Structured3DMesh&>(*(*__smesh).mesh()); |
151 |
SurfaceMeshOfTriangles& surfMesh |
SurfaceMeshOfTriangles& surfaceMesh |
152 |
= dynamic_cast<SurfaceMeshOfTriangles&>(*__mesh); |
= dynamic_cast<SurfaceMeshOfTriangles&>(*__mesh); |
153 |
|
|
154 |
Domain& Omega = (*(*__domain).domain()); |
Domain& Omega = (*(*__domain).domain()); |
155 |
|
|
156 |
TinyVector<3> povObject; |
SurfaceMeshGenerator S; |
157 |
for (size_t i=0; i<3; ++i) |
S.generateSurfacicMesh(Omega, |
158 |
povObject[i] = (*__povObject).value(i); |
surfaceMesh, |
159 |
|
SMesh); |
|
Scene* pS; |
|
|
|
|
|
#warning Clean-up |
|
|
switch ((*__domain).domainType()) { |
|
|
case DomainExpression::variable: { |
|
|
DomainExpressionVariable& d = static_cast<DomainExpressionVariable&>(*__domain); |
|
|
if ((*d.domainExpression()).domainType() != DomainExpression::set) { |
|
|
fferr(0) << __FILE__ << ':' << __LINE__ << ": Not implemented\n"; |
|
|
std::exit(1); |
|
|
} |
|
|
DomainExpressionSet& ds= dynamic_cast<DomainExpressionSet&>(*d.domainExpression()); |
|
|
pS = (*ds.scene()).scene(); |
|
|
break; |
|
|
} |
|
|
case DomainExpression::set: { |
|
|
pS = (*static_cast<DomainExpressionSet&>(*__domain).scene()).scene(); |
|
|
break; |
|
|
} |
|
|
default: { |
|
|
fferr(0) << __FILE__ << ':' << __LINE__ << ": Not implemented\n"; |
|
|
std::exit(1); |
|
|
} |
|
|
} |
|
|
|
|
|
Scene& S = *pS; |
|
|
|
|
|
fferr(0) << __FILE__ << ':' << __LINE__ << ": Not implemented\n"; |
|
|
std::exit(1); |
|
|
// Union U; |
|
|
|
|
|
// for (size_t i=0; i<S.nbObjects(); ++i) { |
|
|
// const Object& O = S.object(i); |
|
|
// if (O.reference() == povObject) { |
|
|
// U.AddObject(O); |
|
|
// ref[i] = true; |
|
|
// } |
|
|
// } |
|
|
// if (U.NbObjects() > 0) { |
|
|
// SMesh.createReferences(Omega); |
|
|
// SMesh.createReferences(Omega,povObject); |
|
|
|
|
|
// SurfaceMeshGenerator S; |
|
|
// S.generateSurfacicMesh(U, |
|
|
// Omega |
|
|
// surfMesh, |
|
|
// SMesh, |
|
|
// ref); |
|
|
// } else { |
|
|
// fferr(2) << "\nObject reference " << povObject |
|
|
// << " not found\n"; |
|
|
// std::exit(1); |
|
|
// } |
|
160 |
} |
} |
161 |
|
|
162 |
MeshExpressionSurface:: |
MeshExpressionSurface:: |
299 |
{ |
{ |
300 |
; |
; |
301 |
} |
} |
302 |
|
|
303 |
|
|
304 |
|
std::ostream& |
305 |
|
MeshExpressionExtract:: |
306 |
|
put(std::ostream& os) const |
307 |
|
{ |
308 |
|
os << "extract(" |
309 |
|
<< (*__originalMesh) << ')'; |
310 |
|
return os; |
311 |
|
} |
312 |
|
|
313 |
|
void |
314 |
|
MeshExpressionExtract:: |
315 |
|
execute() |
316 |
|
{ |
317 |
|
(*__originalMesh).execute(); |
318 |
|
|
319 |
|
switch ((*(*__originalMesh).mesh()).type()) { |
320 |
|
case Mesh::cartesianHexahedraMesh: { |
321 |
|
break; |
322 |
|
} |
323 |
|
case Mesh::hexahedraMesh: { |
324 |
|
break; |
325 |
|
} |
326 |
|
case Mesh::tetrahedraMesh: { |
327 |
|
break; |
328 |
|
} |
329 |
|
case Mesh::surfaceMeshTriangles: { |
330 |
|
MeshExtractor<SurfaceMeshOfTriangles> |
331 |
|
extractor(dynamic_cast<const SurfaceMeshOfTriangles&>(*(*__originalMesh).mesh())); |
332 |
|
__mesh = extractor(1); |
333 |
|
break; |
334 |
|
} |
335 |
|
case Mesh::surfaceMeshQuadrangles: { |
336 |
|
break; |
337 |
|
} |
338 |
|
default: { |
339 |
|
fferr(0) << __FILE__ << ':' << __LINE__ << ": Not implemented\n"; |
340 |
|
std::exit(1); |
341 |
|
} |
342 |
|
} |
343 |
|
} |
344 |
|
|
345 |
|
MeshExpressionExtract:: |
346 |
|
MeshExpressionExtract(ReferenceCounting<MeshExpression> me) |
347 |
|
: MeshExpression(0, MeshExpression::extract), |
348 |
|
__originalMesh(me) |
349 |
|
{ |
350 |
|
; |
351 |
|
} |
352 |
|
|
353 |
|
MeshExpressionExtract:: |
354 |
|
MeshExpressionExtract(const MeshExpressionExtract& e) |
355 |
|
: MeshExpression(e), |
356 |
|
__originalMesh(e.__originalMesh) |
357 |
|
{ |
358 |
|
; |
359 |
|
} |
360 |
|
|
361 |
|
MeshExpressionExtract:: |
362 |
|
~MeshExpressionExtract() |
363 |
|
{ |
364 |
|
; |
365 |
|
} |
366 |
|
|
367 |
|
|
368 |
|
|