#include <dealbase.h>
Public Member Functions | |
DealBase () | |
DealBase (const Triangulation< DIM > &tria) | |
~DealBase () | |
Triangulation< DIM > & | getTriangulation () const |
Cell | getCell (int index) |
Cell | endCell () const |
Cell | beginCell () const |
Face | beginFace () |
Face | endFace () |
void | getFaceBarycenter (Face &face, Point3D &p) |
Point3D | getFaceBarycenter (Face &face) |
double | getCentralValue (const Cell &cell, const VecDouble &values) const |
double | getFaceValue (const Face &face, const VecDouble &values) |
double | getFaceValue (const Cell &cell, FaceDirection3D dir, const VecDouble &values) |
unsigned | getFaceValueIndex (const Cell &cell, FaceDirection3D dir) |
bool | getFaceFlag (const Face &face, const VecBool &values) |
Cell | getCellAtPoint (const Point< DIM > &p) |
double | getNeighborValue (const Cell &cell, CellDirection3D dir, const VecDouble &cValues) |
double | getVerticeValue (const Cell &cell, VertexDirection3D vertex, const VecDouble &values) |
double | getVerticeValue (unsigned vIndex, const VecDouble &values) |
unsigned | getCentralPointIndex (Cell &cell) |
void | getVerticePoint (unsigned vIndex, Point< DIM > &X) const |
Cell | getEndCell () |
Cell | getAdjCell (Cell &cell, CellDirection3D dir) |
Cell | getAdjCell (Cell &cell, CellDirection3D dir1, CellDirection3D dir2) |
bool | getCellFlag (const Cell &cell, const VecBool &cVFlags) const |
bool | getVerticeFlag (const Cell &cell, VertexDirection3D dir, const VecBool &vVFlags) const |
void | setCentralValue (const Cell &cell, double dd, VecDouble &values) |
void | setCentralValue (DoFCell &cell, double dd, VecDouble &values) |
void | setFaceValue (const Face &face, double dd, VecDouble &values) |
void | setFaceValue (const Cell &cell, FaceDirection3D dir, double dd, VecDouble &values) |
void | setFaceFlag (const Face &face, bool b, VecBool &values) |
void | setCellFlag (const Cell &cell, const bool flag, VecBool &cVFlags) const |
void | setVerticeFlag (const Cell &cell, VertexDirection3D dir, const bool flag, VecBool &vVFlags) const |
double | getL2NormAtCells (const VecDouble &cValues) const |
double | getIntegralAtCells (const VecDouble &cValues) const |
unsigned | numCells () const |
unsigned | numFaces () const |
unsigned | numVertices () const |
double | faceArea (Face face) |
int | getAdjCellIndex (unsigned iCell, CellDirection3D dir) |
double | getAdjCellValue (unsigned iCell, CellDirection3D dir, const VecDouble &v) |
int | getFaceIndex (unsigned iCell, FaceDirection3D dir) |
double | getFaceValue (unsigned iCell, FaceDirection3D dir, const VecDouble &v) |
bool | isCellAtBoundary (unsigned iCell) |
bool | hasAdjCell (unsigned iCell, CellDirection3D dir) |
void | setCentralValuesFromFunction (Function3D &f, VecDouble &cValues, unsigned component=0) |
void | setCentralValuesInFunctionDomain (Function3D &f, MapIntDouble &values, unsigned component=0) |
void | setVerticesValuesFromFunction (Function< DIM > &f, VecDouble &vValues, unsigned deg=0) |
void | setFacesValuesFromFunction (Function3D &f, VecDouble &fValues, unsigned deg=0, bool bOnlyPrescribedBoundary=false) |
void | setFacesValuesFromFunction (Function3D &f, Matrix &MValues, bool bOnlyPrescribedBoundary=false) |
void | tagFacesInDomain (Function3D &f, VecTag &tags, char value) |
void | tagFacesInDomain (Function3D &f, VecBool &tags) |
void | setVerticeValue (Cell &cell, VertexDirection3D vertex, double dd, VecDouble &values) |
void | setMaterialIdOfPrescribedBoundaryCells (GeneralFunctionInterface &f, unsigned material_id) |
void | setMaterialIdFromFunctionDomain (GeneralFunctionInterface &f, unsigned material_id) |
void | getCellsInFunctionDomain (Function3D &f, VecIndex &vec) |
void | printMatrixMaple (FullMatrix< double > &M) |
void | printMatrixMaple (SparseMatrix< double > &M) |
void | printVertices () |
void | printCells () |
void | printFaces () |
void | printPoint (const Point< DIM > &P, std::ostream &out) |
void | printVector (const VecDouble &vSol) |
void | printPoint (const Point< DIM > &p) |
void | printCentralValues (const VecDouble &cValues) |
void | printCentralValues (const VecDouble &cValues1, const VecDouble &cValues2) |
void | printCentralValues (const VecDouble &cValues1, const VecDouble &cValues2, const VecDouble &cValues3, const VecDouble &cValues4) |
void | printFacesValuesAtBoundary (const VecDouble &fValues, const VecDouble &fValues2) |
void | printFacesValuesAtBoundary (const VecDouble &fValues1, const VecDouble &fValues2, const VecDouble &fValues3, const VecDouble &fValues4) |
void | printFacesValuesAtBoundary (const VecDouble &fValues) |
void | printCell (Cell cell, std::ostream &out=std::cout) |
void | printCells (VecIndex &vec, std::ostream &out=std::cout) |
bool | isFirstCell (Cell &cell) |
bool | isValid (Cell &cell) |
bool | hasNeighbor (Cell &cell, CellDirection3D dir) |
void | flagPrescribedFaces (Function3D &f, VecBool &vFlags) |
void | setPrescribedBoundaryId (Function3D &f, unsigned boundary_id) |
double | getDX (Cell &cell) |
double | getDZ (Cell &cell) |
double | getDY (Cell &cell) |
Static Public Member Functions | |
static void | printTriangulation (Triangulation< 3 > &tria, std::ostream &out=std::cout) |
Static Public Attributes | |
static const int | INVALID_INDEX = -1 |
Protected Member Functions | |
void | setTriangulation (Triangulation< DIM > &trig) |
Protected Attributes | |
int | n_cells |
Private Attributes | |
Triangulation< DIM > * | m_pTriangulation |
Cell | END_CELL |
MeshDeal3D This class is a Wrapper providing a class Mesh used by the finite volume methods. In background this class call methods from the class Triangulation of the library deal.II
Definition at line 25 of file dealbase.h.
DealBase::DealBase | ( | ) | [inline] |
Definition at line 38 of file dealbase.h.
00038 {m_pTriangulation = NULL;n_cells=-1;}
DealBase::DealBase | ( | const Triangulation< DIM > & | tria | ) | [inline] |
Definition at line 39 of file dealbase.h.
00039 {setTriangulation((Triangulation<DIM>&) tria);}
DealBase::~DealBase | ( | ) | [inline] |
Definition at line 40 of file dealbase.h.
double DealBase::faceArea | ( | Face | face | ) |
Definition at line 902 of file dealbase.cpp.
00903 { 00904 return NumericMethods::squareMeasure(face->vertex(BL_VERTEX), 00905 face->vertex(BR_VERTEX), 00906 face->vertex(UR_VERTEX), 00907 face->vertex(UL_VERTEX)); 00908 }
void DealBase::flagPrescribedFaces | ( | Function3D & | f, | |
VecBool & | vFlags | |||
) |
Definition at line 427 of file dealbase.cpp.
00428 { 00429 assert(vFlags.size() == numFaces()); 00430 for (Face face=beginFace();face!=endFace();face++) 00431 { 00432 Point3D p = face->center(); 00433 setFaceFlag(face,face->at_boundary() && (f.isInDomain(p)),vFlags); 00434 } 00435 }
double DealBase::getDX | ( | Cell & | cell | ) | [inline] |
Definition at line 157 of file dealbase.h.
00157 {return cell->vertex(VERTEX_100)(0)-cell->vertex(VERTEX_000)(0);}
double DealBase::getDY | ( | Cell & | cell | ) | [inline] |
Definition at line 159 of file dealbase.h.
00159 {return cell->vertex(VERTEX_010)(1)-cell->vertex(VERTEX_000)(1);}
double DealBase::getDZ | ( | Cell & | cell | ) | [inline] |
Definition at line 158 of file dealbase.h.
00158 {return cell->vertex(VERTEX_001)(2)-cell->vertex(VERTEX_000)(2);}
double DealBase::getIntegralAtCells | ( | const VecDouble & | cValues | ) | const |
Reimplemented in DealOrthoMesh.
double DealBase::getL2NormAtCells | ( | const VecDouble & | cValues | ) | const |
Reimplemented in DealOrthoMesh.
Triangulation<DIM>& DealBase::getTriangulation | ( | ) | const [inline] |
Definition at line 41 of file dealbase.h.
00041 {assert(m_pTriangulation);return *m_pTriangulation;}
bool DealBase::hasNeighbor | ( | Cell & | cell, | |
CellDirection3D | dir | |||
) | [inline] |
Definition at line 154 of file dealbase.h.
00154 {return (cell->neighbor_index(dir) != DealBase::INVALID_INDEX);}
bool DealBase::isFirstCell | ( | Cell & | cell | ) | [inline] |
Definition at line 152 of file dealbase.h.
00152 {return cell == getTriangulation().begin_active();}
bool DealBase::isValid | ( | Cell & | cell | ) | [inline] |
Definition at line 153 of file dealbase.h.
unsigned DealBase::numCells | ( | ) | const [inline] |
Definition at line 87 of file dealbase.h.
00087 {return n_cells;}
unsigned DealBase::numFaces | ( | ) | const [inline] |
Definition at line 88 of file dealbase.h.
00088 {return getTriangulation().n_active_faces();}
unsigned DealBase::numVertices | ( | ) | const [inline] |
Definition at line 89 of file dealbase.h.
00089 {return getTriangulation().n_vertices();}
void DealBase::printCell | ( | Cell | cell, | |
std::ostream & | out = std::cout | |||
) |
Definition at line 597 of file dealbase.cpp.
00598 { 00599 char str[500]; 00600 sprintf(str,"==== Cell %d ====\n",cell->index()); 00601 out << str; 00602 out << "Barycenter: " << cell->barycenter() << endl; 00603 // cout << "0 = " << cell->vertex(0) << endl; 00604 // cout << "1 = " << cell->vertex(1) << endl; 00605 // cout << "2 = " << cell->vertex(2) << endl; 00606 // cout << "3 = " << cell->vertex(3) << endl; 00607 // cout << "4 = " << cell->vertex(4) << endl; 00608 // cout << "5 = " << cell->vertex(5) << endl; 00609 // cout << "6 = " << cell->vertex(6) << endl; 00610 // cout << "7 = " << cell->vertex(7) << endl; 00611 00612 out << "V000 = " << cell->vertex_index(VERTEX_000) << ") " << cell->vertex(VERTEX_000) << endl; 00613 out << "V100 = " << cell->vertex_index(VERTEX_100) << ") " << cell->vertex(VERTEX_100) << endl; 00614 out << "V110 = " << cell->vertex_index(VERTEX_110) << ") " << cell->vertex(VERTEX_110) << endl; 00615 out << "V010 = " << cell->vertex_index(VERTEX_010) << ") " << cell->vertex(VERTEX_010) << endl; 00616 out << "V001 = " << cell->vertex_index(VERTEX_001) << ") " << cell->vertex(VERTEX_001) << endl; 00617 out << "V101 = " << cell->vertex_index(VERTEX_101) << ") " << cell->vertex(VERTEX_101) << endl; 00618 out << "V111 = " << cell->vertex_index(VERTEX_111) << ") " << cell->vertex(VERTEX_111) << endl; 00619 out << "V011 = " << cell->vertex_index(VERTEX_011) << ") " << cell->vertex(VERTEX_011) << endl; 00620 00621 out << "RIGHT_FACE " << cell->face_index (RIGHT_FACE) << ")" << endl; 00622 out << "LEFT_FACE " << cell->face_index (LEFT_FACE) << ")" << endl; 00623 out << "FRONT_FACE " << cell->face_index (FRONT_FACE) << ")" << endl; 00624 out << "BACK_FACE " << cell->face_index (BACK_FACE) << ")" << endl; 00625 out << "BOTTOM_FACE " << cell->face_index(BOTTOM_FACE) << ")"<< endl; 00626 out << "UP_FACE " << cell->face_index (UP_FACE) << ")" << endl; 00627 00628 00629 }
void DealBase::printCells | ( | VecIndex & | vec, | |
std::ostream & | out = std::cout | |||
) |
Definition at line 966 of file dealbase.cpp.
void DealBase::setPrescribedBoundaryId | ( | Function3D & | f, | |
unsigned | boundary_id | |||
) |
Objetivo: Configurar o ID das faces das celulas localizadas na fronteira e que tem seu valor prescrito pela funcao f. Em outras palavras quando f.isInDomain(face) == PRESCRIBED_BOUNDARY;
Parametros: f = Funcao que designa fronteira. boundary_id = Valor a ser adicionado na face na fronteira. Retorno:
Definition at line 266 of file dealbase.cpp.
00267 { 00268 Cell cell = getTriangulation().begin_active(); 00269 Cell endc = getTriangulation().end(); 00270 00271 for (;cell!=endc;cell++) 00272 { 00273 for (unsigned face_no=0;face_no < GeometryInfo<DIM>::faces_per_cell;face_no++) 00274 { 00275 Face face = cell->face(face_no); 00276 if (face->at_boundary()) 00277 { 00278 bool markFace = true; 00279 for (unsigned ivertex=0;ivertex< GeometryInfo<DIM>::vertices_per_face;ivertex++) 00280 { 00281 if (!f.isInDomain(face->vertex(ivertex))) 00282 { 00283 markFace = false; 00284 break; 00285 } 00286 } 00287 if (markFace) 00288 { 00289 face->set_boundary_indicator(boundary_id); 00290 } 00291 } 00292 } 00293 } 00294 }
void DealBase::setTriangulation | ( | Triangulation< DIM > & | trig | ) | [protected] |
Objetivo: Configurar o membro m_pTriangulation.
Parametros:
Retorno:
Definition at line 14 of file dealbase.cpp.
00015 { 00016 m_pTriangulation = &trig; 00017 END_CELL = getTriangulation().end(); 00018 n_cells=getTriangulation().n_active_cells(); 00019 }
Cell DealBase::END_CELL [private] |
Definition at line 29 of file dealbase.h.
const int DealBase::INVALID_INDEX = -1 [static] |
Definition at line 35 of file dealbase.h.
Triangulation<DIM>* DealBase::m_pTriangulation [private] |
Definition at line 28 of file dealbase.h.
int DealBase::n_cells [protected] |
Definition at line 32 of file dealbase.h.