I want to use the create_mass_matrix and create_laplace_matrix functionality of MatrixCreator namespace. The function prototype here requires to pass a pointer (which is by default 0 meaning that there is no variable coefficient associated with variable or laplace of variable) to a function object. I want to build the mass/laplace matrices taking in account the constraints so I pass the ConstraintMatrix argument as the last argument of the function. Code snippet:
MatrixCreator::create_mass_matrix(dof_handler, QGauss<dim>(fe.degree+1), mass_matrix, ________, constraints);
Here dof_hadler, mass_matrix and constraints are appropriate objects as the name suggests. I don't have the variable coefficient/s so I need to know what to pass in the blank space which requires a pointer argument as mentioned above?
You already gave the answer yourself:
The
documentation tells you that MatrixCreator::create_mass_matrix is declared as
template<int dim, typename number , int spacedim>
void MatrixCreator::create_mass_matrix
(const Mapping< dim, spacedim > & mapping,
const DoFHandler< dim, spacedim > & dof,
const Quadrature< dim > & q,
SparseMatrix< number > & matrix,
const Function< spacedim > *const a = 0,
const ConstraintMatrix & constraints = ConstraintMatrix())
In particular, using a null pointer (0, NULL or nullptr) for the 'Function' pointer 'a' gives you a constant coefficient equal to one.
Best,
Daniel