7from .MatrixGenerator
import MatrixGenerator
13 Simple matrix generator for continuous d-linear finite elements
15 This factory method is there for convenience, i.e. users can take it to
16 pre-assemble local matrices and then to pipe it into the Peano 4 multigrid
17 classes. Most of the stuff in here in hard-coded, so only well-suited for
18 relatively primitive solvers. You might want to specialise these routines,
19 switch to a more sophisticated matrix generator, or abandon the idea of a
20 matrix generator altogether.
28 super( DLinear, self ).
__init__(dimensions,
30 unknowns_per_node = unknowns_per_node
39 @todo should this be 2**D or (p+1)**D? suppose it's not relevant, given this is a linear solver
47 Return identity matrix and a 0 as the identity matrix has no intrinsic
48 scaling, i.e. its scaling is @f$ h^0 @f$.
51 dim = self.
_cell_dofs * self.unknowns_per_vertex_dof
60 Get this working for 2d.
62 What about 3d? If we select an index for the first dimension
63 and then sum over the other two (ie call np.sum( massMatrix[i,] ))
64 it will just add up all elements along the 2 other dimensions, as
65 if we flattened it. Is this what we want?
69 output = np.zeros_like(massMatrix)
70 for i
in range( output.shape[0] ):
71 output[i,i] = np.sum( massMatrix[i,] )
78 Create a cell-cell mass matrix
80 This matrix does not couple the individual unknowns per degree of freedom.
81 The resulting matrix has to be scaled by @f$ h^d @f$.
83 Use the mass matrix generated for DG Interior Penalty for Poisson equation.
93 Create a cell-cell mass matrix
95 In a finite element context, this matrix has to be
96 scaled with @f$ h^{d-2} @f$. Therefore, we retturn d-2 as second argument.
98 Use the cell-cell matrix generated for DG Interior Penalty for Poisson equation.
Simple matrix generator for continuous d-linear finite elements.
get_cell_system_matrix_for_laplacian(self)
Create a cell-cell mass matrix.
get_cell_mass_matrix(self)
Create a cell-cell mass matrix.
get_lumped_mass_matrix(self)
Get this working for 2d.
get_cell_identity_matrix(self)
Return identity matrix and a 0 as the identity matrix has no intrinsic scaling, i....
__init__(self, dimensions, unknowns_per_node)
Base class for generating matrices that we pipe into the C++ code.
get_cell_mass_matrix(self)
Factory for cell mass matrix.
Classical DG discretisation of 2d classical Poisson formulation with spurious facet function spaces.