7from .MatrixGenerator
import MatrixGenerator
12 Using normalised identity matrix instead of the mass matrix.
13 This is necessary when the residual is computed as b-A*u instead of
14 M*b-A*u, for example, when using CG solver for the coarse-grid correction
19 Simple matrix generator for continuous d-linear finite elements
21 This factory method is there for convenience, i.e. users can take it to
22 pre-assemble local matrices and then to pipe it into the Peano 4 multigrid
23 classes. Most of the stuff in here in hard-coded, so only well-suited for
24 relatively primitive solvers. You might want to specialise these routines,
25 switch to a more sophisticated matrix generator, or abandon the idea of a
26 matrix generator altogether.
35 super( DLinearMassIdentity, self ).
__init__(dimensions,
46 @todo should this be 2**D or (p+1)**D? suppose it's not relevant, given this is a linear solver
54 Return identity matrix and a 0 as the identity matrix has no intrinsic
55 scaling, i.e. its scaling is @f$ h^0 @f$.
67 Get this working for 2d.
69 What about 3d? If we select an index for the first dimension
70 and then sum over the other two (ie call np.sum( massMatrix[i,] ))
71 it will just add up all elements along the 2 other dimensions, as
72 if we flattened it. Is this what we want?
76 output = np.zeros_like(massMatrix)
77 for i
in range( output.shape[0] ):
78 output[i,i] = np.sum( massMatrix[i,] )
84 Here we use a normalised identity matrix instead of the mass matrix.
85 To achieve the result (Id_global * b_global), the local matrix should be
86 divided by 2^dimensions, see get_cell_identity_matrix().
87 For example, in 2D, it is 0.25*Id, which, when summed
88 for 4 cells sharing each interior vertex, will result in the global identity.
89 Note that this does not differentiate between interior and boundary vertices.
93 Create a cell-cell mass matrix
95 This matrix does not couple the individual unknowns per degree of freedom.
96 The resulting matrix has to be scaled by @f$ h^d @f$.
98 Use the mass matrix generated for DG Interior Penalty for Poisson equation.
109 Create a cell-cell mass matrix
111 In a finite element context, this matrix has to be
112 scaled with @f$ h^{d-2} @f$. Therefore, we retturn d-2 as second argument.
114 Use the cell-cell matrix generated for DG Interior Penalty for Poisson equation.
Using normalised identity matrix instead of the mass matrix.
get_cell_mass_matrix(self)
Here we use a normalised identity matrix instead of the mass matrix.
__init__(self, dimensions, poly_degree, unknowns_per_node)
get_cell_identity_matrix(self)
Return identity matrix and a 0 as the identity matrix has no intrinsic scaling, i....
get_lumped_mass_matrix(self)
Get this working for 2d.
get_cell_system_matrix_for_laplacian(self)
Create a cell-cell mass matrix.
Base class for generating matrices that we pipe into the C++ code.
get_cell_identity_matrix(self)
Construct identity for this particular equation system.
get_cell_mass_matrix(self)
Factory for cell mass matrix.
Classical DG discretisation of 2d classical Poisson formulation with spurious facet function spaces.