src/tetmesh/face.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           face.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 "matrix.h"
00019 #include "linalg.h"
00020 #include "vector3.h"
00021 #include "point.h"
00022 #include "face.h"
00023 #include "tetmesh.h"
00024 
00025 namespace mesh {
00026 
00027 using namespace colarray;
00028 
00029 Face::Face(id_t id, id_t node0, id_t node1, id_t node2, id_t tet) :
00030     Entity(id)
00031 { 
00032     _tets[0] = tet;
00033     _tets[1] = ID_NONE;
00034 }
00035 
00036 Point* Face::get_corner(int i) const {
00037     return get_mesh()->get_point(get_corner_id(i)); 
00038 }
00039 
00040 Edge* Face::get_edge(int i) const {
00041         return get_mesh()->get_edge(get_edge_id(i));    
00042 }
00043 
00044 id_t Face::get_corner_id(int i) const {
00045     Tet* tet = get_mesh()->get_tet(get_tet_id());
00046     
00047     // Query info of parent Tet 
00048     int face_lid;
00049     for (face_lid = 0; face_lid < 4; ++ face_lid)
00050         if (tet->get_face_id(face_lid) == get_id())
00051             break;
00052     assert(face_lid < 4);
00053     int node_lids[3];
00054     tet->get_face_point_lids(face_lid, node_lids[0], node_lids[1], node_lids[2]);
00055     return tet->get_corner_id(node_lids[i]);
00056 }
00057 
00058 id_t Face::get_edge_id(int i) const {
00059     Tet* tet = get_mesh()->get_tet(get_tet_id());
00060     
00061     // Query info of parent Tet 
00062     int face_lid;
00063     for (face_lid = 0; face_lid < 4; ++ face_lid)
00064         if (tet->get_face_id(face_lid) == get_id())
00065             break;
00066     assert(face_lid < 4);
00067     int edge_lids[3];
00068     tet->get_face_edge_lids(face_lid, edge_lids[0], edge_lids[1], edge_lids[2]);
00069     return tet->get_edge_id(edge_lids[i]);
00070 }
00071 
00072 TetMesh* Face::get_mesh() const {
00073     return TetMesh::get_instance();
00074 }
00075 
00076 } // namespace mesh

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