MOERTEL::Manager Class Reference

Top level user interface to the mortar package 'Moertel'. More...

#include <mrtr_manager.H>

List of all members.

Public Types

 manager_none
 manager_2D
 manager_3D
enum  DimensionType { manager_none, manager_2D, manager_3D }
 Specification of the problem dimension.

Public Member Functions

 Manager (Epetra_Comm &comm, MOERTEL::Manager::DimensionType dimension, int outlevel)
 Creates and empty instance of this class.
 Manager (Epetra_Comm &comm, int outlevel)
 Creates and empty instance of this class.
virtual ~Manager ()
 Destroys an instance of this class.
Epetra_Comm & Comm () const
 Returns the Epetra_Comm object associated with this class.
int OutLevel ()
 Returns the Level of output (0 - 10) the user specified in the constructor.
MOERTEL::Manager::DimensionType Dimension ()
 Query the problem dimension.
int Ninterfaces ()
 Query the number of interfaces passed to this class via AddInterface.
bool Print () const
 Print all information stored in this class to stdout.
void SetDimension (MOERTEL::Manager::DimensionType type)
 Set problem dimension.
bool AddInterface (MOERTEL::Interface &interface)
 Add an interface class to this class.
Teuchos::ParameterList & Default_Parameters ()
 Obtain a parameter list with default values.
bool Mortar_Integrate ()
 Perform integration of the mortar integral on all interfaces.
bool SetProblemMap (const Epetra_Map *map)
 Set the RowMap of the original uncoupled problem.
Epetra_Map * ProblemMap () const
 Return view of row map of the uncoupled problem.
bool SetInputMatrix (Epetra_CrsMatrix *inputmatrix, bool DeepCopy=false)
 Set the Matrix of the original uncoupled problem.
Epetra_CrsMatrix * MakeSaddleProblem ()
 Construct a saddle point system of equations.
Epetra_CrsMatrix * MakeSPDProblem ()
 Construct a spd system of equations if possible.
Epetra_CrsMatrix * GetRHSMatrix ()
 returns the righ hand side matrix of the spd system of equations
void SetSolverParameters (ParameterList &params)
 Set a parameter list holding solver parameters.
bool Solve (ParameterList &params, Epetra_Vector &sol, const Epetra_Vector &rhs)
 Solve the problem.
bool Solve (Epetra_Vector &sol, const Epetra_Vector &rhs)
 Solve the problem.
void ResetSolver ()
 Reset the internal solver.
const Epetra_CrsMatrix * D () const
 Get pointer to constraints matrix D.
const Epetra_CrsMatrix * M () const
 Get pointer to constraints matrix M.

Protected Attributes

int outlevel_
Epetra_Comm & comm_
DimensionType dimensiontype_
map< int, RefCountPtr< MOERTEL::Interface > > interface_
RefCountPtr< Epetra_Map > problemmap_
RefCountPtr< Epetra_CrsMatrix > inputmatrix_
RefCountPtr< Epetra_Map > constraintsmap_
RefCountPtr< Epetra_CrsMatrix > D_
RefCountPtr< Epetra_CrsMatrix > M_
RefCountPtr< Epetra_Map > saddlemap_
RefCountPtr< Epetra_CrsMatrix > saddlematrix_
RefCountPtr< Epetra_CrsMatrix > spdmatrix_
RefCountPtr< Epetra_CrsMatrix > spdrhs_
RefCountPtr< map< int, int > > lm_to_dof_
RefCountPtr< Epetra_CrsMatrix > I_
RefCountPtr< Epetra_CrsMatrix > WT_
RefCountPtr< Epetra_CrsMatrix > B_
RefCountPtr< Epetra_Map > annmap_
RefCountPtr< Teuchos::ParameterList > integrationparams_
RefCountPtr< Teuchos::ParameterList > solverparams_
RefCountPtr< MOERTEL::Solversolver_

Friends

class MOERTEL::Solver


Detailed Description

Top level user interface to the mortar package 'Moertel'.

Date:
Last update do Doxygen: 20-March-06


Constructor & Destructor Documentation

MOERTEL::Manager::Manager ( Epetra_Comm &  comm,
MOERTEL::Manager::DimensionType  dimension,
int  outlevel 
) [explicit]

Creates and empty instance of this class.

Constructs an empty instance of this class that is then filled buy the user with information about the non-conforming interface(s).
This is a collective call for all processors associated with the Epetra_Comm

Parameters:
comm : An Epetra_Comm object
dimension : Dimension of the problem
outlevel : The level of output to stdout to be generated ( 0 - 10 )

MOERTEL::Manager::Manager ( Epetra_Comm &  comm,
int  outlevel 
) [explicit]

Creates and empty instance of this class.

Constructs an empty instance of this class that is then filled buy the user with information about the non-conforming interface(s).
This is a collective call for all processors associated with the Epetra_Comm

Parameters:
comm : An Epetra_Comm object
outlevel : The level of output to stdout to be generated ( 0 - 10 )

MOERTEL::Manager::~Manager (  )  [virtual]

Destroys an instance of this class.

Destructor


Member Function Documentation

bool MOERTEL::Manager::AddInterface ( MOERTEL::Interface interface  ) 

Add an interface class to this class.

Add a previously constructed interface to this class. Before adding an interface,the interfaces's public method MOERTEL::Interface::Complete() has to be called. This class will not accept interface that are not completed. Any number of interfaces can be added. This class does not take ownership over the added class. The interface added can be destroyed immediately after the call to this method as this class stores a deep copy of it.

Parameters:
interface : A completed interface
Returns:
true when adding the interface was successfull and false otherwise

Teuchos::ParameterList & MOERTEL::Manager::Default_Parameters (  ) 

Obtain a parameter list with default values.

Obtain a parameter list containing deafult values for integration of mortar interfaces. Default values set are:

    // When true, values of shape functions are exact at
    // every single integration point.
    // When false, linear shape functions of an overlap 
    // discretization are used to linearily interpolate 
    // shape functions in the overlap region.
    // The latter is significantly cheaper but only 
    // recommended for truly linear functions, e.g. with 
    // 1D interfaces discretized with linear elements
    // 2D interfaces discretized with linear triangle elements
    // It is NOT recommended for 2D interfaces discretized with
    // bilinear quads as shape functions are not truly linear.
    integrationparams_->set("exact values at gauss points",true);

    // 1D interface possible values are 1,2,3,4,5,6,7,8,10
    integrationparams_->set("number gaussian points 1D",3);

    // 2D interface possible values are 3,6,12,13,16,19,27
    integrationparams_->set("number gaussian points 2D",12);

See also:
SetProblemMap , AddInterface, Mortar_integrate

MOERTEL::Manager::DimensionType MOERTEL::Manager::Dimension (  )  [inline]

Query the problem dimension.

Query the problem dimension

Epetra_CrsMatrix * MOERTEL::Manager::GetRHSMatrix (  ) 

returns the righ hand side matrix of the spd system of equations

If dual Lagrange multipliers are used, a symm. positive definit system of equations can be constructed from the saddle point problem. The final solution of the problem is then obtained from
Atilde x = RHSMatrix * b

See also:
MakeSPDProblem()

Epetra_CrsMatrix * MOERTEL::Manager::MakeSaddleProblem (  ) 

Construct a saddle point system of equations.

After a call to Mortar_Integrate() a saddle point system of equations can be constructed and returned to the user. Prerequisite is that the user has supplied the original uncoupled matrix via SetInputMatrix and the integration was performed with Mortar_Integrate(). This class holds ownership of the saddle point system so the user must not destroy it.

Epetra_CrsMatrix * MOERTEL::Manager::MakeSPDProblem (  ) 

Construct a spd system of equations if possible.

If dual Lagrange multipliers are used, a symm. positive definit system of equations can be constructed from the saddle point problem. The final solution of the problem is then obtained from
Atilde x = RHSMatrix * b

See also:
GetSPDRHSMatrix()

bool MOERTEL::Manager::Mortar_Integrate (  ) 

Perform integration of the mortar integral on all interfaces.

Once all interfaces and a row map of the original system are passed to this class this method evaluates the mortar integrals on all interfaces.

Proceding:

Returns:
true if successfull, false otherwise
See also:
SetProblemMap , AddInterface

int MOERTEL::Manager::Ninterfaces (  )  [inline]

Query the number of interfaces passed to this class via AddInterface.

Returns the number of non-conforming interfaces passed to this class via AddInterface

Epetra_Map* MOERTEL::Manager::ProblemMap (  )  const [inline]

Return view of row map of the uncoupled problem.

return a view of the row map of the uncoupled problem the user provided using SetProblemMap. Returns NULL if no row map was previously set.

See also:
SetProblemMap

void MOERTEL::Manager::ResetSolver (  ) 

Reset the internal solver.

The internal solver (no matter which one) will go on using the once constructed (and maybe factored) matrix until this method is called. After a call to this method, the linear problem as well as the solver are build from scratch.

void MOERTEL::Manager::SetDimension ( MOERTEL::Manager::DimensionType  type  )  [inline]

Set problem dimension.

This class can handle 2D and 3D problems but not both at the same time. It is necessary to specify the dimension of the problem

Parameters:
type : Dimension of the problem

bool MOERTEL::Manager::SetInputMatrix ( Epetra_CrsMatrix *  inputmatrix,
bool  DeepCopy = false 
)

Set the Matrix of the original uncoupled problem.

Passes in the Matrix of the original (uncoupled) problem. In a saddle point system, this would be the the (1,1) block. This class takes ownership of the matrix if DeepCopy is set to true.

The matrix of the original, uncoupled problem is used to construct a saddle point system via MakeSaddleProblem() or solve the coupled problem

Parameters:
map : Matrix of the original (uncoupled) problem
See also:
MakeSaddleProblem()

bool MOERTEL::Manager::SetProblemMap ( const Epetra_Map *  map  ) 

Set the RowMap of the original uncoupled problem.

Passes in the RowMap of the original (uncoupled) problem. In a saddle point system, this would be the row map of the (1,1) block. This class does not take ownership of the passed in map. The map can be destroyed immediately after the call to this method as this class stores a deep copy of it. A row map has to be passed to this class before a call to Mortar_Integrate()

Parameters:
map : Row map of the original (uncoupled) problem
See also:
Mortar_Integrate()

void MOERTEL::Manager::SetSolverParameters ( ParameterList &  params  ) 

Set a parameter list holding solver parameters.

Set a ParameterList containing solver options. This class does not take ownership over params but instead uses a view of it.
Currently Moertel has interfaces to the Amesos, the AztecOO and the ML package.
All packages are controlled by this parameter list. The parameter list Contains a general part where the package and the type of linear system to be generated is chosen and contains one or more sub-parameter lists which are passed on to the appropiate package. This way all parameters described in the documentation of Amesos, ML and Aztec can be passed to the approbiate package.

Below one example how to choose the parameter list is given:

  Teuchos::ParameterList params;
  params.set("System","SaddleSystem"); // use a saddle point system of equations in solve
  // or
  params.set("System","SPDSystem");    // use a spd system with condensed Lagrange multipliers in solve

  // choose solver package
  params.set("Solver","Amesos");       // use solver package Amesos
  // or
  params.set("Solver","ML/Aztec");     // use solver packages ML and AztecOO
  
  // argument sublist passed to and used for Amesos
  // see Amesos documentation, all configured Amesos solvers can be used
  // This is an example of possible parameters
  Teuchos::ParameterList& amesosparams = params.sublist("Amesos");
  amesosparams.set("Solver","Amesos_Klu"); // name of Amesos solver to use
  amesosparams.set("PrintTiming",false);   
  amesosparams.set("PrintStatus",false);   
  amesosparams.set("UseTranspose",true);

  // argument sublist passed to and used for ML
  // see ML documentation, all configured parameters recognized by the
  // ML_Epetra::ml_MultiLevelPreconditioner class can be used
  // Moertel sets the ML default parameters first which are then overridden by
  // this list
  // This is an example configuration:
  Teuchos::ParameterList& mlparams = params.sublist("ML");
  ML_Epetra::SetDefaults("SA",mlparams);
  mlparams.set("output",6);
  mlparams.set("print unused",-2);
  mlparams.set("increasing or decreasing","increasing");
  mlparams.set("PDE equations",3);
  mlparams.set("max levels",20);
  mlparams.set("aggregation: type","Uncoupled");
  mlparams.set("coarse: max size",2500);
  mlparams.set("coarse: type","Amesos-KLU");
  mlparams.set("smoother: type","MLS");
  mlparams.set("smoother: MLS polynomial order",3);
  mlparams.set("smoother: sweeps",1);
  mlparams.set("smoother: pre or post","both");
  mlparams.set("null space: type","pre-computed");
  mlparams.set("null space: add default vectors",false);
  int dimnullspace  = 6;
  int dimnsp        = dimnullspace*nummyrows;
  double* nsp       = new double[dimnsp];
  application_compute_nullspace(nsp,dimnsp);
  mlparams.set("null space: dimension",dimnullspace);
  // the user is responsible for freeing nsp after solve
  mlparams.set("null space: vectors",nsp); 

  // argument sublist passed to and used for AztecOO
  // see AztecOO documentation, all configured parameters recognized by the
  // AztecOO class can be used
  // Moertel sets the Aztec default parameters first which are then overridden by
  // this list
  // This is an example configuration:
  Teuchos::ParameterList& aztecparams = params.sublist("Aztec");
  aztecparams.set("AZ_solver","AZ_cg");
  // if "AZ_user_precond" is specified, ML will be used as a preconditioner
  // Any other aztec-buildin preconditioner can be used as well 
  aztecparams.set("AZ_precond","AZ_user_precond");
  aztecparams.set("AZ_max_iter",500);
  aztecparams.set("AZ_output",100);
  aztecparams.set("AZ_tol",1.0e-08);
  aztecparams.set("AZ_scaling","AZ_none");

Parameters:
params : Parameter list containing solver options
Warning:
When using ML and/or Aztec, one has to use "SPDSystem" as system matrix as the amg-preconditioned iterative method will currently fail on the saddle point system.

bool MOERTEL::Manager::Solve ( Epetra_Vector &  sol,
const Epetra_Vector &  rhs 
)

Solve the problem.

Solve the coupled problem using the solver options previously supplied in using SetSolverParameters Succesive calls to this method will resue the system matrix together with the supplied solution and rhs vectors until ResetSolver() is called. Then, the linear problem is recreated from scratch.

Parameters:
sol (out) : The solution
rhs (in) : The right hand side vector

bool MOERTEL::Manager::Solve ( ParameterList &  params,
Epetra_Vector &  sol,
const Epetra_Vector &  rhs 
)

Solve the problem.

Solve the coupled problem using the solver options supplied in params. Succesive calls to this method will resue the system matrix together with the supplied solution and rhs vectors until ResetSolver() is called. Then, the linear problem is recreated from scratch.

Parameters:
params (in) : Solution parameters
sol (out) : The solution
rhs (in) : The right hand side vector


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:38:47 2010 for Moertel by  doxygen 1.4.7