00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00057 Ae = Matrix<double>(6, 6);
00058 }
00059 if (Me.get_m() != 6 || Me.get_n() != 6) {
00060
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 }