src/fem/nedelecmesh.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           nedelecmesh.h  -  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 #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     // int get_nof_mapped_dofs(int order) const;
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         /* quality factor calculation for specific eigenpar where lambda is the
00130          * eigenvalue and q ist the eigenvector; offers seamless parallel and serial usage */
00131         double NedelecMesh::quality(double lambda, const double* q) const;
00132 
00133 
00138     double q_factor(double lambda, const double* q) const;
00139 
00140     //return pointer to the tetmesh of this nedelec_mesh
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

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