#include <Quadrangle.hpp>


Public Types | |
| enum | { NumberOfVertices = 4, NumberOfFaces = 4, NumberOfEdges = 4 } |
| typedef Edge | FaceType |
| enum | Type { hexahedron, cartesianHexahedron, hexahedronByEdge, tetrahedron, triangle3d, quadrangle3d } |
Public Member Functions | |
| const TinyVector< 3, real_t > | normal () const |
| size_t | numberOfVertices () const |
| virtual Cell::Type | type () const |
| Quadrangle () | |
| Quadrangle (const Vertex &V0, const Vertex &V1, const Vertex &V2, const Vertex &V3, const size_t reference=0) | |
| Quadrangle (const TinyVector< NumberOfVertices, Vertex * > &vertices, const size_t reference=0) | |
| Quadrangle (const Quadrangle &q) | |
| ~Quadrangle () | |
| const Cell & | mother () const |
| size_t | motherCellFaceNumber () const |
| void | setMother (const Cell *cell, const size_t faceNumber) |
| bool | find (const Vertex *P) |
| const real_t & | volume () const |
| void | replace (Vertex *v0, Vertex *v1) |
| const bool & | isFictitious () const |
| void | setFictitious (const bool &b) const |
| const size_t & | reference () const |
| size_t & | reference () |
| Vertex & | operator() (const size_t &i) |
| const Vertex & | operator() (const size_t &i) const |
Static Public Attributes | |
| static const size_t | faces [NumberOfEdges][FaceType::NumberOfVertices] = {{0,1},{1,2},{2,3},{3,0}} |
| static const size_t | edges [NumberOfEdges][Edge::NumberOfVertices] = {{0,1},{1,2},{2,3},{3,0}} |
Protected Attributes | |
| const Cell * | __motherCell |
| size_t | __motherCellFaceNumber |
| size_t | __reference |
| Reference of the Cell. | |
| real_t | __volume |
| Volume or surface of the cell. | |
| Vertex ** | __vertices |
| Pointers on vertices of the cell. | |
| bool | __isFictitious |
| indicates if the cell is to be taken into accounts for computations | |
Private Member Functions | |
| void | __computeVolume () |
Definition at line 39 of file Quadrangle.hpp.
| typedef Edge Quadrangle::FaceType |
Definition at line 67 of file Quadrangle.hpp.
| anonymous enum |
| NumberOfVertices | number of vertices |
| NumberOfFaces | number of faces |
| NumberOfEdges | number of edges |
Definition at line 61 of file Quadrangle.hpp.
00061 { 00062 NumberOfVertices = 4, 00063 NumberOfFaces = 4, 00064 NumberOfEdges = 4 00065 };
enum Cell::Type [inherited] |
Definition at line 40 of file Cell.hpp.
00040 { 00041 hexahedron, 00042 cartesianHexahedron, 00043 hexahedronByEdge, 00044 tetrahedron, 00045 triangle3d, 00046 quadrangle3d 00047 };
| Quadrangle::Quadrangle | ( | ) | [inline] |
Constructs the structure
Definition at line 121 of file Quadrangle.hpp.
References Cell::__volume.
00122 : SurfElem(NumberOfVertices) 00123 { 00124 __volume = 0.; 00125 }
| Quadrangle::Quadrangle | ( | const Vertex & | V0, | |
| const Vertex & | V1, | |||
| const Vertex & | V2, | |||
| const Vertex & | V3, | |||
| const size_t | reference = 0 | |||
| ) | [inline] |
Constructor: the quadrangle is defined by 4 vertices
| V0 | first vertex | |
| V1 | second vertex | |
| V2 | third vertex | |
| V3 | fourth vertex | |
| reference | the reference of this quadrangle (default is 0) |
Definition at line 137 of file Quadrangle.hpp.
References __computeVolume(), and Cell::__vertices.
00142 : SurfElem(NumberOfVertices, reference) 00143 { 00144 __vertices[0] = (Vertex*)&V0; 00145 __vertices[1] = (Vertex*)&V1; 00146 __vertices[2] = (Vertex*)&V2; 00147 __vertices[3] = (Vertex*)&V3; 00148 00149 this->__computeVolume(); 00150 }

| Quadrangle::Quadrangle | ( | const TinyVector< NumberOfVertices, Vertex * > & | vertices, | |
| const size_t | reference = 0 | |||
| ) | [inline] |
Constructor: the quadrangle is defined by 4 vertices
| vertices | the vertices set | |
| reference | the reference of this quadrangle (default is 0) |
Definition at line 159 of file Quadrangle.hpp.
References __computeVolume(), Cell::__vertices, and NumberOfVertices.
00161 : SurfElem(NumberOfVertices, reference) 00162 { 00163 for (size_t i=0; i<NumberOfVertices; ++i) { 00164 __vertices[i] = vertices[i]; 00165 } 00166 00167 this->__computeVolume(); 00168 }

| Quadrangle::Quadrangle | ( | const Quadrangle & | q | ) | [inline] |
Copy Constructor
| q | the quadrangle to copy |
Definition at line 177 of file Quadrangle.hpp.
00178 : SurfElem(q) 00179 { 00180 ; 00181 }
| Quadrangle::~Quadrangle | ( | ) | [inline] |
| void Quadrangle::__computeVolume | ( | ) | [inline, private] |
Definition at line 44 of file Quadrangle.hpp.
References Cell::__vertices, and Cell::__volume.
Referenced by Quadrangle().
00045 { 00046 const TinyVector<3>& v0 = *(__vertices[0]); 00047 const TinyVector<3>& v1 = *(__vertices[1]); 00048 const TinyVector<3>& v2 = *(__vertices[2]); 00049 const TinyVector<3>& v3 = *(__vertices[3]); 00050 00051 const TinyVector<3> A(v1-v0); 00052 const TinyVector<3> B(v3-v0); 00053 00054 const TinyVector<3> C(v1-v2); 00055 const TinyVector<3> D(v3-v2); 00056 00057 __volume = 0.5*(Norm(A^B)+Norm(C^D)); 00058 }
| const TinyVector<3, real_t> Quadrangle::normal | ( | ) | const [inline, virtual] |
Returns the *mean* normal to the face.
Implements SurfElem.
Definition at line 77 of file Quadrangle.hpp.
References Cell::__vertices.
Referenced by ConformTransformationQ1Hexahedron::__inside().
00078 { 00079 // IN This Function We Assume That The 4 Vertices Are Aligned. 00080 // Could be better to use the mean value ... 00081 00082 const TinyVector<3>& v0 = *(__vertices[0]); 00083 const TinyVector<3>& v1 = *(__vertices[1]); 00084 const TinyVector<3>& v2 = *(__vertices[2]); 00085 const TinyVector<3>& v3 = *(__vertices[3]); 00086 00087 const TinyVector<3> A(v2-v0); 00088 const TinyVector<3> B(v3-v1); 00089 TinyVector<3> N(A^B); 00090 const real_t n = Norm(N); 00091 N/=n; 00092 return N; 00093 }
| size_t Quadrangle::numberOfVertices | ( | ) | const [inline, virtual] |
Access to the number of vertices of this Cell.
Implements Cell.
Definition at line 101 of file Quadrangle.hpp.
References NumberOfVertices.
00102 { 00103 return NumberOfVertices; 00104 }
| virtual Cell::Type Quadrangle::type | ( | ) | const [inline, virtual] |
Returns the type of the cell
Implements Cell.
Definition at line 111 of file Quadrangle.hpp.
References Cell::quadrangle3d.
00112 { 00113 return Cell::quadrangle3d; 00114 }
| const Cell& SurfElem::mother | ( | ) | const [inline, inherited] |
Access to the mother cell
Definition at line 55 of file SurfElem.hpp.
References SurfElem::__motherCell, and ASSERT.
Referenced by SurfaceMeshGenerator::Internals::__constructionFinalMesh(), SurfaceMeshGenerator::Internals::__createTrianglesIntersection(), MeshSimplifier::__proceed(), and SurfaceMeshGenerator::Internals::__setMotherCells().
00056 { 00057 ASSERT(__motherCell!=0); 00058 return *__motherCell; 00059 }
| size_t SurfElem::motherCellFaceNumber | ( | ) | const [inline, inherited] |
Access to the mother cell face number
Definition at line 65 of file SurfElem.hpp.
References SurfElem::__motherCell, SurfElem::__motherCellFaceNumber, and ASSERT.
00066 { 00067 ASSERT(__motherCell!=0); 00068 return __motherCellFaceNumber; 00069 }
| void SurfElem::setMother | ( | const Cell * | cell, | |
| const size_t | faceNumber | |||
| ) | [inline, inherited] |
Sets the mother cell
Definition at line 75 of file SurfElem.hpp.
References SurfElem::__motherCell, and SurfElem::__motherCellFaceNumber.
Referenced by SurfaceMeshGenerator::Internals::__addTriangle(), SurfaceMeshGenerator::Internals::__constructionFinalMesh(), SurfaceMeshGenerator::Internals::__dataStructureConvertion(), MeshSimplifier::__proceed(), SurfaceMeshGenerator::Internals::__setMotherCells(), SpectralMesh::SpectralMesh(), and Structured3DMesh::Structured3DMesh().
00077 { 00078 __motherCell = cell; 00079 __motherCellFaceNumber = faceNumber; 00080 }
| bool Cell::find | ( | const Vertex * | P | ) | [inline, inherited] |
Find the vertex P in the cell
Definition at line 69 of file Cell.hpp.
References Cell::__vertices, and Cell::numberOfVertices().
Referenced by Triangulation::__checkLine().
00069 { 00070 for(size_t i=0 ; i<numberOfVertices() ; ++i) { 00071 if(__vertices[i]==P) { 00072 return true; 00073 } 00074 } 00075 return false; 00076 }

| const real_t& Cell::volume | ( | ) | const [inline, inherited] |
Read-only access to the volume of the cell
Definition at line 83 of file Cell.hpp.
References Cell::__volume.
Referenced by FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember(), ConformTransformationP1TriangleJacobian::ConformTransformationP1TriangleJacobian(), ConformTransformationQ1QuadrangleJacobian::ConformTransformationQ1QuadrangleJacobian(), BoundaryConditionDiscretizationSpectralNonConform::getDiagonal(), BoundaryConditionDiscretizationSpectralNonConform::setSecondMember(), BoundaryConditionDiscretizationSpectralNonConform::timesX(), and BoundaryConditionDiscretizationSpectralNonConform::transposedTimesX().
00084 { 00085 return __volume; 00086 }
Replaces a vertex by another
| v0 | the vertex to replace | |
| v1 | the new vertex |
Definition at line 94 of file Cell.hpp.
References Cell::__vertices, Cell::numberOfVertices(), stringify(), and ErrorHandler::unexpected.
00095 { 00096 for (size_t i = 0; i<numberOfVertices(); ++i) { 00097 if (__vertices[i] == v0) { 00098 __vertices[i] = v1; 00099 return; 00100 } 00101 } 00102 00103 const std::string errorMsg 00104 = "vertex "+stringify(v0)+" was not found while replacing "+stringify(v1); 00105 00106 throw ErrorHandler(__FILE__,__LINE__, 00107 errorMsg, 00108 ErrorHandler::unexpected); 00109 }

| const bool& Cell::isFictitious | ( | ) | const [inline, inherited] |
Read-only access to the fictitious state of the cell
Definition at line 116 of file Cell.hpp.
References Cell::__isFictitious.
Referenced by FEMDiscretization< Structured3DMesh, TypeOfDiscretization >::assembleSecondMember().
00117 { 00118 return __isFictitious; 00119 }
| void Cell::setFictitious | ( | const bool & | b | ) | const [inline, inherited] |
Sets fictitious state of the cell
Definition at line 127 of file Cell.hpp.
References Cell::__isFictitious.
Referenced by FictitiousDomainMethod::Compute().
00128 { 00129 __isFictitious = b; 00130 }
| const size_t& Cell::reference | ( | ) | const [inline, inherited] |
Read-only access to the reference of the Cell.
Definition at line 151 of file Cell.hpp.
References Cell::__reference.
Referenced by SurfaceMeshGenerator::Internals::__constructionFinalMesh(), SurfaceMeshGenerator::Internals::__createGeneral(), SurfaceMeshGenerator::Internals::__createSurface(), SurfaceMeshGenerator::Internals::__createTriangle(), SurfaceMeshGenerator::Internals::__createTrianglesIntersection(), SurfaceMeshGenerator::Internals::__generateMesh(), SurfaceMeshGenerator::Internals::__putRefByFront(), SurfaceMeshGenerator::Internals::UnionTest::compute(), SurfaceMeshGenerator::Internals::IntersectionTest::compute(), SurfaceMeshGenerator::generateSurfacicMesh(), and MeshDomainTetrahedrizor::run().
00152 { 00153 return __reference; 00154 }
| size_t& Cell::reference | ( | ) | [inline, inherited] |
Access to the reference of the Cell.
Definition at line 161 of file Cell.hpp.
References Cell::__reference.
00162 { 00163 return __reference; 00164 }
| Vertex& Cell::operator() | ( | const size_t & | i | ) | [inline, inherited] |
Access to the ith Vertex of the Cell.
| i | the local number of the vertex |
Definition at line 173 of file Cell.hpp.
References Cell::__vertices, ASSERT, and Cell::numberOfVertices().
00174 { 00175 ASSERT (i<numberOfVertices()); 00176 return *__vertices[i]; 00177 }

| const Vertex& Cell::operator() | ( | const size_t & | i | ) | const [inline, inherited] |
Read-only access to the ith Vertex of the Cell.
| i | the local number of the vertex |
Definition at line 186 of file Cell.hpp.
References Cell::__vertices, ASSERT, and Cell::numberOfVertices().
00187 { 00188 ASSERT (i<numberOfVertices()); 00189 return *(__vertices[i]); 00190 }

const size_t Quadrangle::faces = {{0,1},{1,2},{2,3},{3,0}} [static] |
Definition at line 69 of file Quadrangle.hpp.
const size_t Quadrangle::edges = {{0,1},{1,2},{2,3},{3,0}} [static] |
Definition at line 70 of file Quadrangle.hpp.
const Cell* SurfElem::__motherCell [protected, inherited] |
The mother cell (ie: a 3d element which interacts with the triangle)
Definition at line 47 of file SurfElem.hpp.
Referenced by SurfElem::mother(), SurfElem::motherCellFaceNumber(), SurfElem::operator=(), and SurfElem::setMother().
size_t SurfElem::__motherCellFaceNumber [protected, inherited] |
Definition at line 48 of file SurfElem.hpp.
Referenced by SurfElem::motherCellFaceNumber(), SurfElem::operator=(), and SurfElem::setMother().
size_t Cell::__reference [protected, inherited] |
real_t Cell::__volume [protected, inherited] |
Volume or surface of the cell.
Definition at line 54 of file Cell.hpp.
Referenced by Triangle::__computeVolume(), __computeVolume(), CartesianHexahedron::CartesianHexahedron(), Hexahedron::Hexahedron(), Cell::operator=(), Quadrangle(), Tetrahedron::Tetrahedron(), and Cell::volume().
Vertex** Cell::__vertices [protected, inherited] |
Pointers on vertices of the cell.
Definition at line 57 of file Cell.hpp.
Referenced by Triangle::__computeVolume(), __computeVolume(), ConnectedTriangle::base(), CartesianHexahedron::CartesianHexahedron(), Cell::Cell(), Triangle::edge(), Cell::find(), CartesianHexahedron::getLocalCoordinates(), Hexahedron::Hexahedron(), Triangle::normal(), normal(), Cell::operator()(), Cell::operator=(), Quadrangle(), Cell::replace(), ConnectedTriangle::setVertices(), Tetrahedron::Tetrahedron(), Triangle::Triangle(), and Cell::~Cell().
bool Cell::__isFictitious [mutable, protected, inherited] |
indicates if the cell is to be taken into accounts for computations
Definition at line 60 of file Cell.hpp.
Referenced by Cell::isFictitious(), and Cell::setFictitious().
1.5.6