src/fem/nedelecelement1.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           nedelecelement1.cpp  -  description
00003                              -------------------
00004     begin                : Fri Dec 19 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 "nedelecelement1.h"
00019 
00020 using namespace colarray;
00021 using namespace mesh;
00022 
00023 NedelecElement1::NedelecElement1()
00024 { }
00025 
00026 NedelecElement1::~NedelecElement1()
00027 { }
00028 
00029 const int* NedelecElement1::get_dof_ids(mesh::TetMesh* m, mesh::Tet* tet) const {
00030     static int dof_ids[6];
00031     for (int i = 0; i < 6; i ++) {
00032         dof_ids[i] = tet->get_edge_id(i);
00033     }
00034     return dof_ids;
00035 }
00036 
00037 const bool* NedelecElement1::get_eliminated_dofs(mesh::TetMesh* m,
00038                                                  mesh::Tet* tet,
00039                                                  unsigned int sym_plane_config) const {
00040     static bool eliminated_dofs[6];
00041     for (int i = 0; i < 6; i ++) {
00042         if (tet->get_edge(i)->on_boundary()) {
00043             eliminated_dofs[i] = true;      
00044         } else if ((sym_plane_config ^ 0x7) & tet->get_edge(i)->on_symmetry_planes()) {
00045             eliminated_dofs[i] = true;
00046         } else {
00047             eliminated_dofs[i] = false;
00048         }
00049     }
00050     return eliminated_dofs;
00051 }
00052       
00053 void NedelecElement1::get_element_matrix(mesh::Tet* tet, Matrix<double>& Ae, Matrix<double>& Me) {
00054 
00055     if (Ae.get_m() != 6 || Ae.get_n() != 6) {
00056         // inappropriate Matrix shape: reassign
00057         Ae = Matrix<double>(6, 6);
00058     }
00059     if (Me.get_m() != 6 || Me.get_n() != 6) {
00060         // inappropriate Matrix shape: reassign
00061         Me = Matrix<double>(6, 6);
00062     }
00063 
00064 #ifndef GAUSSIANQUADRATURE  
00065     Tet::GradientMatrix J(*tet);
00066     get_Ae(tet, 1, J, Ae);
00067     get_Me(tet, 1, J, Me);
00068 #else
00069     get_AeMe(tet, 1, Ae, Me);
00070 #endif
00071 }
00072 
00073 mesh::Vector3 NedelecElement1::eval(Tet* tet, const Vector3& x, const Vector<double>& dof) {
00074     mesh::Tet::GradientMatrix J(*tet);
00075     return eval_cartesian(tet, 1, dof, J, x);  
00076 }
00077 mesh::Vector3 NedelecElement1::eval_curl(Tet* tet, const Vector3& x, const Vector<double>& dof) {
00078     mesh::Tet::GradientMatrix J(*tet);
00079     return eval_curl_cartesian(tet, 1, dof, J, x);  
00080 }

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