00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef NEDELECMESH_H
00019 #define NEDELECMESH_H
00020
00021 #include "Epetra_CrsMatrix.h"
00022 #include "Epetra_FECrsMatrix.h"
00023 #include "tetmesh/paralleltetmesh.h"
00024 #include <vector>
00025
00026 #include "tetmesh/tetmesh.h"
00027 #include "tetmesh/vector3.h"
00028 #include "colarray/vector.h"
00029 #include "nedelecelement.h"
00030
00031 #include "tetmesh/entity.h"
00032
00053 class NedelecMesh {
00054 public:
00062 NedelecMesh(mesh::TetMesh* mesh, int order, unsigned int sym_plane_config);
00063 ~NedelecMesh();
00064
00066 NedelecElement* get_element(mesh::id_t i) const
00067 { return _element; }
00068
00071 void assembleAM(Epetra_FECrsMatrix* A, Epetra_FECrsMatrix* M);
00072
00076 mesh::id_t get_num_my_dofs(int order) const;
00077
00081
00082
00083 mesh::id_t get_num_global_dofs(int order) const;
00084
00085 mesh::id_t get_num_global_mdofs(int order) const;
00086
00090 mesh::id_t gdof(mesh::id_t ldof) const;
00091
00095 bool is_owned_gdof(mesh::id_t gdof) const;
00096
00100 mesh::id_t map_dof(mesh::id_t orig_dof) const;
00101
00104 int map_dof_rev(int mapped_dof) const;
00105
00119 void set_map(unsigned int sym_plane_config);
00120
00123 mesh::Vector3 eval(const mesh::Vector3& x, const colarray::Vector<double>& q) const;
00124
00127 mesh::Vector3 eval_curl(const mesh::Vector3& x, const colarray::Vector<double>& q) const;
00128
00129
00130
00131 double NedelecMesh::quality(double lambda, const double* q) const;
00132
00133
00138 double q_factor(double lambda, const double* q) const;
00139
00140
00141 mesh::TetMesh* getTetMesh()const
00142 {return _mesh;}
00143
00144 void generate_sorted_AM(const Epetra_FECrsMatrix* A, const Epetra_FECrsMatrix* M, Epetra_FECrsMatrix* A_s, Epetra_FECrsMatrix* M_s);
00145
00146 private:
00147
00148 typedef std::pair<mesh::id_t, mesh::id_t> nodepair;
00149 typedef utility::triple<nodepair, mesh::id_t, mesh::id_t> dof_with_ids;
00150 void sort_matrix(const Epetra_FECrsMatrix* M, Epetra_FECrsMatrix* M_s, const vector<dof_with_ids>& all_dofs);
00151
00153 mesh::TetMesh* _mesh;
00155 mesh::ParallelTetMesh* _pmesh;
00156
00158 NedelecElement* _element;
00160 int _order;
00164 std::map<mesh::id_t, mesh::id_t> _mgid_map;
00166 std::vector<mesh::id_t> _map_rev;
00168 std::vector<mesh::id_t> _nof_orig_dofs;
00170 std::vector<mesh::id_t> _nof_mapped_dofs;
00172 std::vector<mesh::id_t> _num_global_dofs;
00173 };
00174
00175 #endif