To build and solve the linear system for the Poisson problem using the DG P1 2-D triangle element. More...


Public Member Functions | |
LaplaceDG2DP1 (Mesh &ms, Vect< real_t > &f, Vect< real_t > &Dbc, Vect< real_t > &Nbc, Vect< real_t > &u) | |
Constructor with mesh and vector data. More... | |
~LaplaceDG2DP1 () | |
Destructor. | |
void | set (real_t sigma, real_t eps) |
Set parameters for the DG method. More... | |
void | set (const LocalMatrix< real_t, 2, 2 > &K) |
Set diffusivity matrix. More... | |
void | build () |
Build global matrix and right-hand side. More... | |
void | Smooth (Vect< real_t > &u) |
Perform post calculations. More... | |
int | run () |
Build and solve the linear system of equations using an iterative method. More... | |
int | setGraph () |
Set matrix graph. | |
Detailed Description
To build and solve the linear system for the Poisson problem using the DG P1 2-D triangle element.
This class build the linear system of equations for a standard elliptic equation using the Discontinuous Galerkin P1 finite element method.
Constructor & Destructor Documentation
LaplaceDG2DP1 | ( | Mesh & | ms, |
Vect< real_t > & | f, | ||
Vect< real_t > & | Dbc, | ||
Vect< real_t > & | Nbc, | ||
Vect< real_t > & | u | ||
) |
Constructor with mesh and vector data.
- Parameters
-
[in] ms Mesh instance [in] f Vector containing the right-hand side of the elliptic equation at triangle vertices [in] Dbc Vector containing prescribed values of the solution (Dirichlet boundary condition) at nodes having a positive code [in] Nbc Vector containing prescribed values of the flux (Neumann boundary condition) at each side having a positive code [in] u Vector where the solution is stored once the linear system is solved
Member Function Documentation
Set parameters for the DG method.
- Parameters
-
[in] sigma Penalty parameters to enforce continuity at nodes (Must be positive) [Default: 100
][in] eps Epsilon value of the DG method to choose among the values: - 0 Incomplete Interior Penalty Galerkin method (IIPG)
- -1 Symmetric Interior Penalty Galerkin method (SIPG)
- 1 Non symmetric interior penalty Galerkin method (NIPG)
eps=-1
andsigma>100
which leads to a symmetric positive definite matrix [Default:-1
]
void set | ( | const LocalMatrix< real_t, 2, 2 > & | K | ) |
Set diffusivity matrix.
This function provides the diffusivity matrix as instance of class LocalMatrix. The default diffusivity matrix is the identity matrix
- Parameters
-
[in] K Diffusivity matrix
void build | ( | ) |
Build global matrix and right-hand side.
The problem matrix and right-hand side are the ones used in the constructor. They are updated in this member function.
Perform post calculations.
This function gives an averaged solution given at mesh nodes (triangle vertices) by a standard L2-projection method.
- Parameters
-
[in] u Solution at nodes
int run | ( | ) |
Build and solve the linear system of equations using an iterative method.
The matrix is preconditioned by the diagonal ILU method. The linear system is solved either by the Conjugate Gradient method if the matrix is symmetric positive definite (eps=-1
) or the GMRES method if not. The solution is stored in the vector u
given in the constructor.
- Returns
- Number of performed iterations. Note that the maximal number is 1000 and the tolerance is 1.e-8