00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <new>
00019 #include "tetmeshbuilder.h"
00020
00021 TetMeshBuilder::TetMeshBuilder() {
00022 _mesh = new mesh::TetMesh();
00023 }
00024
00025 TetMeshBuilder::TetMeshBuilder(MPI_Comm comm) {
00026 _mesh = new mesh::ParallelTetMesh(comm);
00027 }
00028
00029 TetMeshBuilder::~TetMeshBuilder() {
00030 }
00031
00032 void TetMeshBuilder::init_coord(int nof_node) {
00033 _mesh->initPoint(nof_node);
00034 }
00035
00036 void TetMeshBuilder::set_coord(int i, double x, double y, double z) {
00037 _mesh->insertPoint(i, x, y, z);
00038 }
00039
00040 void TetMeshBuilder::finalize_coord() {
00041 _mesh->generateEdges();
00042 _mesh->generateFaces();
00043 }
00044
00045 void TetMeshBuilder::init_tet(int nof_tet) {
00046 _mesh->initTet(nof_tet);
00047 }
00048
00049 void TetMeshBuilder::set_tet(int t, int id0, int id1, int id2, int id3, int material) {
00050 _mesh->insertTet(t, id0, id1, id2, id3, material);
00051 }
00052
00053 void TetMeshBuilder::finalize_tet() {
00054 _mesh->generateEdges();
00055 _mesh->generateFaces();
00056 }
00057
00058 void TetMeshBuilder::init_bc(int nof_bc_face) {
00059
00060 }
00061
00062 void TetMeshBuilder::set_bc(int id0, int id1, int id2, int bc_id) {
00063 mesh::id_t face = _mesh->lookupFace(id0, id1, id2);
00064 if (bc_id == 0) {
00065 _mesh->setBoundaryOnFace(face);
00066 } else {
00067 assert((0 < bc_id) && (bc_id <= 3));
00068 _mesh->setSymmetryPlaneOnFace(face, bc_id - 1);
00069 }
00070 }
00071
00072 void TetMeshBuilder::finalize_bc(int nof_sym) {
00073 _mesh->finalize_mesh(nof_sym);
00074 }