Trilinos based (stochastic) FEM solvers
meshpp.hpp
Go to the documentation of this file.
1 /*
2 Brian Staber (brian.staber@gmail.com)
3 */
4 
5 #ifndef MESHPP_HPP
6 #define MESHPP_HPP
7 
8 //Standard includes
9 #include <stdio.h>
10 #include <iostream>
11 #include <istream>
12 #include <fstream>
13 #include <vector>
14 #include <iomanip>
15 //Epetra includes
16 #include "Epetra_MpiComm.h"
17 #include "Epetra_FECrsGraph.h"
18 #include "Epetra_FECrsMatrix.h"
19 #include "Epetra_FEVector.h"
20 #include "Epetra_Vector.h"
21 #include "Epetra_Map.h"
22 #include "Epetra_SerialDenseMatrix.h"
23 #include "Epetra_SerialDenseVector.h"
24 #include "Epetra_IntSerialDenseVector.h"
25 #include "Epetra_Import.h"
26 #include "Epetra_Export.h"
27 #include "Epetra_Time.h"
28 //ML includes
29 #include "ml_MultiLevelPreconditioner.h"
30 #include "ml_epetra_utils.h"
31 #include "ml_include.h"
32 //EpetraExt includes
33 #include "EpetraExt_RowMatrixOut.h"
34 #include "EpetraExt_MultiVectorOut.h"
35 #include "EpetraExt_VectorIn.h"
36 #include "EpetraExt_MultiVectorIn.h"
37 //Teuchos includes
38 #include "Teuchos_RCP.hpp"
39 //Amesos includes
40 #include "Amesos.h"
41 //AztecOO includes
42 #include "AztecOO.h"
43 #include "Amesos_BaseSolver.h"
44 //Metis include
45 #include "metis.h"
46 //My includes
47 #include "fepp.hpp"
48 
49 class mesh
50 {
51 
52 public:
53  mesh();
54  mesh(std::string & fileName_mesh, double scaling);
55  mesh(Epetra_Comm & comm, std::string & fileName_mesh, double scaling);
56  ~mesh();
57 
58  int read_gmsh(std::string & fileName_mesh, double scaling);
59  int read_boundary_file(std::string & fileName_bc, unsigned int & number_physical_groups);
60  int metis_part_mesh(int & NumProc);
61  void get_local_nodes(int & MyPID);
62  void get_cells_and_ghosts(int & MyPID);
63  Epetra_SerialDenseVector get_cartesian_coordinate(unsigned int & e_gid, unsigned int & gp);
64 
65  void store_feinterp_faces();
66  void store_feinterp_cells();
67  void update_store_feinterp_cells(Epetra_Vector & u, Epetra_Map & OverlapMap);
68 
69  Epetra_Comm* Comm;
70 
71  Epetra_SerialDenseMatrix N_faces, D1_N_faces, D2_N_faces;
72 
74 
75  Epetra_IntSerialDenseMatrix nodes_to_boundaries;
76 
77  std::vector<double> nodes_coord;
78  std::vector<int> cells_nodes, faces_nodes;
80  std::vector<int> local_nodes, local_dof;
81  std::vector<int> local_cells, local_faces;
82 
83  idx_t * epart;
84  idx_t * npart;
86 
87  int n_nodes = 0;
88  int n_cells = 0;
89  int n_faces = 0;
90  int el_type = 0;
91  int face_type = 0;
93  int n_local_nodes = 0;
94  int n_local_cells = 0;
95  int n_local_faces = 0;
96 
97  unsigned int n_gauss_faces;
98  unsigned int n_gauss_cells;
99  Epetra_SerialDenseVector gauss_weight_cells, gauss_weight_faces;
100  Epetra_SerialDenseVector xi_cells, eta_cells, zeta_cells;
101  Epetra_SerialDenseVector xi_faces, eta_faces;
102 };
103 
104 #endif
void store_feinterp_cells()
Definition: meshpp.cpp:546
idx_t * epart
Definition: meshpp.hpp:83
u
Definition: run.m:9
std::vector< int > local_nodes
Definition: meshpp.hpp:80
std::vector< int > local_faces
Definition: meshpp.hpp:81
int n_local_faces
Definition: meshpp.hpp:95
Epetra_SerialDenseVector DZ_N_cells
Definition: meshpp.hpp:73
std::vector< double > nodes_coord
Definition: meshpp.hpp:77
std::vector< int > local_dof
Definition: meshpp.hpp:80
Epetra_SerialDenseMatrix D2_N_faces
Definition: meshpp.hpp:71
int metis_part_mesh(int &NumProc)
Definition: meshpp.cpp:297
Epetra_SerialDenseVector N_cells
Definition: meshpp.hpp:73
Epetra_Comm * Comm
Definition: meshpp.hpp:69
int n_local_cells
Definition: meshpp.hpp:94
idx_t * npart
Definition: meshpp.hpp:84
int * NumIndicesPerRow
Definition: meshpp.hpp:85
void get_local_nodes(int &MyPID)
Definition: meshpp.cpp:347
Epetra_SerialDenseVector eta_cells
Definition: meshpp.hpp:100
Epetra_SerialDenseMatrix N_faces
Definition: meshpp.hpp:71
Epetra_SerialDenseVector vol_cells
Definition: meshpp.hpp:73
unsigned int n_gauss_faces
Definition: meshpp.hpp:97
Epetra_SerialDenseVector xi_cells
Definition: meshpp.hpp:100
Epetra_SerialDenseVector local_rows
Definition: meshpp.hpp:73
int read_boundary_file(std::string &fileName_bc, unsigned int &number_physical_groups)
Definition: meshpp.cpp:270
int face_type
Definition: meshpp.hpp:91
void update_store_feinterp_cells(Epetra_Vector &u, Epetra_Map &OverlapMap)
Definition: meshpp.cpp:628
Epetra_SerialDenseVector DX_N_cells
Definition: meshpp.hpp:73
mesh()
Definition: meshpp.cpp:7
Epetra_SerialDenseVector detJac_cells
Definition: meshpp.hpp:73
Definition: meshpp.hpp:49
Epetra_IntSerialDenseMatrix nodes_to_boundaries
Definition: meshpp.hpp:75
std::vector< int > local_cells
Definition: meshpp.hpp:81
int n_local_nodes_without_ghosts
Definition: meshpp.hpp:92
Epetra_SerialDenseVector xi_faces
Definition: meshpp.hpp:101
int n_local_nodes
Definition: meshpp.hpp:93
std::vector< int > faces_nodes
Definition: meshpp.hpp:78
int el_type
Definition: meshpp.hpp:90
Epetra_SerialDenseVector DY_N_cells
Definition: meshpp.hpp:73
std::vector< int > cells_nodes
Definition: meshpp.hpp:78
void get_cells_and_ghosts(int &MyPID)
Definition: meshpp.cpp:359
Epetra_SerialDenseMatrix D1_N_faces
Definition: meshpp.hpp:71
unsigned int n_gauss_cells
Definition: meshpp.hpp:98
Epetra_SerialDenseVector get_cartesian_coordinate(unsigned int &e_gid, unsigned int &gp)
Definition: meshpp.cpp:427
int n_cells
Definition: meshpp.hpp:88
Epetra_SerialDenseVector gauss_weight_faces
Definition: meshpp.hpp:99
int read_gmsh(std::string &fileName_mesh, double scaling)
Definition: meshpp.cpp:64
std::vector< int > local_nodes_without_ghosts
Definition: meshpp.hpp:79
std::vector< int > local_dof_without_ghosts
Definition: meshpp.hpp:79
void store_feinterp_faces()
Definition: meshpp.cpp:460
int n_nodes
Definition: meshpp.hpp:87
~mesh()
Definition: meshpp.cpp:59
Epetra_SerialDenseVector eta_faces
Definition: meshpp.hpp:101
Epetra_SerialDenseVector zeta_cells
Definition: meshpp.hpp:100
Epetra_SerialDenseVector gauss_weight_cells
Definition: meshpp.hpp:99
int n_faces
Definition: meshpp.hpp:89