src/tetmeshbuilder.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           tetmeshbuilder.h.cpp  -  description
00003                              -------------------
00004     begin                : Fri Dec 12 2003
00005     copyright            : (C) 2003 by Roman Geus
00006     email                : roman.geus@psi.ch
00007 ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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 //Dag: This is not used in the ParallelTetMesh class since it appearently has no function and the local no. of faces is not known at this time in the parallel reader.
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 }

Generated on Fri Oct 26 13:35:13 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7