SALSA Analysis Modules
Customization

While this library comes with a number of categories supplied, you can write your own category, taking any of the given ones as example.

Each analysis module has to have the following prototype:

static PetscErrorCode MyModule(Mat A,AnalysisItem *rv,PetscBool *flg)

where

The module return code should be 0 for success, anything else for (catastrophic) failure. A simple failure (or refusal) to compute should be indicated through the flg variable.

The modules (including the return type of their computed quantities) are declared to the system by calling routine

PetscErrorCode RegisterMyModules()
{
  PetscErrorCode ierr;
  PetscFunctionBegin;

  ierr = RegisterModule
    ("mycategory","mymodule",THERESULTTYPE,&MyModule); CHKERRQ(ierr);
  ....

or you can make the invidual calls to RegisterModule(). See types and Array type handling.