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,
40 @todo should this be 2**D or (p+1)**D? suppose it's not relevant, given this is a linear solver
48 Return identity matrix and a 0 as the identity matrix has no intrinsic
49 scaling, i.e. its scaling is @f$ h^0 @f$.
52 dim = self.
_cell_dofs * self.unknowns_per_vertex_dof
54 output = np.eye(dim,dim) * 2**(-self.
dimensions)
61 Get this working for 2d.
63 What about 3d? If we select an index for the first dimension
64 and then sum over the other two (ie call np.sum( massMatrix[i,] ))
65 it will just add up all elements along the 2 other dimensions, as
66 if we flattened it. Is this what we want?
70 output = np.zeros_like(massMatrix)
71 for i
in range( output.shape[0] ):
72 output[i,i] = np.sum( massMatrix[i,] )
79 Create a cell-cell mass matrix
81 This matrix does not couple the individual unknowns per degree of freedom.
82 The resulting matrix has to be scaled by @f$ h^d @f$.
84 Use the mass matrix generated for DG Interior Penalty for Poisson equation.
94 Create a cell-cell mass matrix
96 In a finite element context, this matrix has to be
97 scaled with @f$ h^{d-2} @f$. Therefore, we retturn d-2 as second argument.
99 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.
Classical DG discretisation of 2d classical Poisson formulation with spurious facet function spaces.