Create and destroy PETSc objects with smart pointer
static char help[] =
"...\n\n";
int main(
int argc,
char *argv[]) {
try {
auto check = [&](const int expected) {
"use count should be %d but is %d", expected,
};
{
CHKERR MatCreate(PETSC_COMM_SELF, &
m);
}
{ std::ignore = static_cast<PetscObject>(m_ptr); }
{
}
CHKERR MatSetSizes(m_ptr, 2, 2, 2, 2);
{
{
}
}
{
}
m_ptr.reset();
{
}
}
return 0;
}
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.