Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

omg.h File Reference

Defines the basic MG class, which provides an octree based Multigrid compatible with PETSc. More...

#include "petscpc.h"
#include "petscksp.h"
#include <vector>

Go to the source code of this file.

Namespaces

namespace  ot
namespace  par

Classes

struct  ot::_p_DAMG
 The Octree-Multigrid Object. More...
class  ot::FineTouchedDummyStatus
 A class used within the dummy restriction operation. More...
class  ot::FineTouchedStatus
 A private class used inside Restriction and Prolongation. More...
class  par::Mpi_datatype< ot::FineTouchedDummyStatus >
class  par::Mpi_datatype< ot::FineTouchedStatus >
struct  ot::PC_KSP_Shell
 A private preconditioner object used within DAMG at the coarsest grid when not all processors are active on the coarsest grid. More...
struct  ot::TransferOpData
 Context used for storing information required by the inter-grid transfer operators. More...

Defines

#define DAMGGetB(ctx)   (ctx)[(ctx)[0]->nlevels-1]->B
 The finest level preconditioning matrix.
#define DAMGGetComm(ctx)   (ctx)[(ctx)[0]->nlevels-1]->comm
 Returns the MPI communicator.
#define DAMGGetDA(ctx)   ((ctx)[(ctx)[0]->nlevels-1]->da)
 The finest grid ot::DA* object.
#define DAMGGetDAMG(ctx)   (ctx)[(ctx)[0]->nlevels-1]
 The finest DAMG.
#define DAMGGetFine(ctx)   (ctx)[(ctx)[0]->nlevels-1]
 The finest DAMG object.
#define DAMGGetJ(ctx)   (ctx)[(ctx)[0]->nlevels-1]->J
 The finest level matrix.
#define DAMGGetKSP(ctx)   (ctx)[(ctx)[0]->nlevels-1]->ksp
 The finest grid KSP object.
#define DAMGGetLevels(ctx)   (ctx)[0]->nlevels
 The total number of levels.
#define DAMGGetr(ctx)   (ctx)[(ctx)[0]->nlevels-1]->r
 The residual vector at the finest level.
#define DAMGGetRHS(ctx)   (ctx)[(ctx)[0]->nlevels-1]->b
 The RHS vector at the finest level.
#define DAMGGetUser(ctx, level)   ((ctx)[level]->user)
 The user context at this level.
#define DAMGGetx(ctx)   (ctx)[(ctx)[0]->nlevels-1]->x
 The finest level Vec object containing the solution.
#define DAMGSetUser(ctx, level, usr)   ((ctx)[level]->user = usr,0)
 Set the user context for this level.
#define PROF_MG_CREATE_RP1_BEGIN   PetscFunctionBegin;
#define PROF_MG_CREATE_RP1_END   PetscFunctionReturn(0);
#define PROF_MG_CREATE_RP2_BEGIN   PetscFunctionBegin;
#define PROF_MG_CREATE_RP2_END   PetscFunctionReturn(0);
#define PROF_MG_FINAL_BEGIN   PetscFunctionBegin;
#define PROF_MG_FINAL_END   PetscFunctionReturn(0);
#define PROF_MG_INIT_BEGIN   PetscFunctionBegin;
#define PROF_MG_INIT_END   PetscFunctionReturn(0);
#define PROF_MG_PROLONG_BEGIN   PetscFunctionBegin;
#define PROF_MG_PROLONG_END   PetscFunctionReturn(0);
#define PROF_MG_RESTRICT_BEGIN   PetscFunctionBegin;
#define PROF_MG_RESTRICT_DUMMY_BEGIN   PetscFunctionBegin;
#define PROF_MG_RESTRICT_DUMMY_END   PetscFunctionReturn(0);
#define PROF_MG_RESTRICT_END   PetscFunctionReturn(0);
#define PROF_MG_SCATTER_BEGIN
#define PROF_MG_SCATTER_END   return 0;
#define PROF_MG_SET_DA_BEGIN   PetscFunctionBegin;
#define PROF_MG_SET_DA_END   PetscFunctionReturn(0);
#define PROF_MG_SET_KSP_BEGIN   PetscFunctionBegin;
#define PROF_MG_SET_KSP_END   PetscFunctionReturn(0);
#define PROF_MG_SETUP_BEGIN   PetscFunctionBegin;
#define PROF_MG_SETUP_END   PetscFunctionReturn(0);
#define PROF_PC_KSP_SHELL_APPLY_BEGIN   PetscFunctionBegin;
#define PROF_PC_KSP_SHELL_APPLY_END   PetscFunctionReturn(0);
#define PROF_PC_KSP_SHELL_DESTROY_BEGIN   PetscFunctionBegin;
#define PROF_PC_KSP_SHELL_DESTROY_END   PetscFunctionReturn(0);
#define PROF_PC_KSP_SHELL_SETUP_BEGIN   PetscFunctionBegin;
#define PROF_PC_KSP_SHELL_SETUP_END   PetscFunctionReturn(0);
#define PROF_SET_DA_STAGE1_BEGIN
#define PROF_SET_DA_STAGE1_END
#define PROF_SET_DA_STAGE2_BEGIN
#define PROF_SET_DA_STAGE2_END
#define PROF_SET_DA_STAGE3_BEGIN
#define PROF_SET_DA_STAGE3_END
#define PROF_SET_DA_STAGE4_BEGIN
#define PROF_SET_DA_STAGE4_END
#define PROF_SET_DA_STAGE5_BEGIN
#define PROF_SET_DA_STAGE5_END
#define PROF_SET_DA_STAGE6_BEGIN
#define PROF_SET_DA_STAGE6_END

Typedefs

typedef _p_DAMG * DAMG

Functions

PetscErrorCode DAMGCreateJMatrix (DAMG damg, PetscErrorCode(*crJ)(DAMG, Mat *J))
 This is the function used to create the J matrix. This must be called before calling DAMGSetKSP if you want to set J and B to be different. If this is not called, by default J and B will be equal.
PetscErrorCode DAMGSetKSP (DAMG *damg, PetscErrorCode(*crjac)(DAMG, Mat *B), PetscErrorCode(*computeJac)(DAMG, Mat J, Mat B), PetscErrorCode(*rhs)(DAMG, Vec))
 Set function handles to create and set values in the matrices and compute the RHS.
PetscErrorCode DAMGSetNullSpace (DAMG *damg, PetscTruth, int, PetscErrorCode(*)(DAMG, Vec[]))


Detailed Description

Defines the basic MG class, which provides an octree based Multigrid compatible with PETSc.

Author:
Rahul S Sampath, rahul.sampath@gmail.com
Date:
2007-04-22
Defines the basic MG class, which provides an octree based Multigrid compatible with PETSc.

Definition in file omg.h.


Define Documentation

#define DAMGGetB ctx   )     (ctx)[(ctx)[0]->nlevels-1]->B
 

The finest level preconditioning matrix.

Definition at line 564 of file omg.h.

#define DAMGGetComm ctx   )     (ctx)[(ctx)[0]->nlevels-1]->comm
 

Returns the MPI communicator.

Definition at line 552 of file omg.h.

#define DAMGGetDA ctx   )     ((ctx)[(ctx)[0]->nlevels-1]->da)
 

The finest grid ot::DA* object.

Definition at line 582 of file omg.h.

Referenced by main().

#define DAMGGetDAMG ctx   )     (ctx)[(ctx)[0]->nlevels-1]
 

The finest DAMG.

Definition at line 606 of file omg.h.

#define DAMGGetFine ctx   )     (ctx)[(ctx)[0]->nlevels-1]
 

The finest DAMG object.

Definition at line 570 of file omg.h.

Referenced by ot::DAMGSolve().

#define DAMGGetJ ctx   )     (ctx)[(ctx)[0]->nlevels-1]->J
 

The finest level matrix.

Definition at line 558 of file omg.h.

Referenced by main().

#define DAMGGetKSP ctx   )     (ctx)[(ctx)[0]->nlevels-1]->ksp
 

The finest grid KSP object.

Definition at line 576 of file omg.h.

#define DAMGGetLevels ctx   )     (ctx)[0]->nlevels
 

The total number of levels.

Definition at line 600 of file omg.h.

#define DAMGGetr ctx   )     (ctx)[(ctx)[0]->nlevels-1]->r
 

The residual vector at the finest level.

Definition at line 540 of file omg.h.

#define DAMGGetRHS ctx   )     (ctx)[(ctx)[0]->nlevels-1]->b
 

The RHS vector at the finest level.

Definition at line 534 of file omg.h.

Referenced by main().

#define DAMGGetUser ctx,
level   )     ((ctx)[level]->user)
 

The user context at this level.

Definition at line 588 of file omg.h.

#define DAMGGetx ctx   )     (ctx)[(ctx)[0]->nlevels-1]->x
 

The finest level Vec object containing the solution.

Definition at line 546 of file omg.h.

Referenced by main(), solve_neumann(), and solve_neumann_oct().

#define DAMGSetUser ctx,
level,
usr   )     ((ctx)[level]->user = usr,0)
 

Set the user context for this level.

Definition at line 594 of file omg.h.

#define PROF_MG_CREATE_RP1_BEGIN   PetscFunctionBegin;
 

Definition at line 201 of file omg.h.

Referenced by ot::createInterpolationType1().

#define PROF_MG_CREATE_RP1_END   PetscFunctionReturn(0);
 

Definition at line 203 of file omg.h.

Referenced by ot::createInterpolationType1().

#define PROF_MG_CREATE_RP2_BEGIN   PetscFunctionBegin;
 

Definition at line 205 of file omg.h.

Referenced by ot::createInterpolationType2().

#define PROF_MG_CREATE_RP2_END   PetscFunctionReturn(0);
 

Definition at line 207 of file omg.h.

Referenced by ot::createInterpolationType2().

#define PROF_MG_FINAL_BEGIN   PetscFunctionBegin;
 

Definition at line 185 of file omg.h.

Referenced by ot::DAMG_Finalize().

#define PROF_MG_FINAL_END   PetscFunctionReturn(0);
 

Definition at line 187 of file omg.h.

Referenced by ot::DAMG_Finalize().

#define PROF_MG_INIT_BEGIN   PetscFunctionBegin;
 

Definition at line 181 of file omg.h.

Referenced by ot::DAMG_Initialize().

#define PROF_MG_INIT_END   PetscFunctionReturn(0);
 

Definition at line 183 of file omg.h.

Referenced by ot::DAMG_Initialize().

#define PROF_MG_PROLONG_BEGIN   PetscFunctionBegin;
 

Definition at line 221 of file omg.h.

Referenced by ot::prolongMatVecType1().

#define PROF_MG_PROLONG_END   PetscFunctionReturn(0);
 

Definition at line 223 of file omg.h.

Referenced by ot::prolongMatVecType1().

#define PROF_MG_RESTRICT_BEGIN   PetscFunctionBegin;
 

Definition at line 213 of file omg.h.

Referenced by ot::restrictMatVecType1().

#define PROF_MG_RESTRICT_DUMMY_BEGIN   PetscFunctionBegin;
 

Definition at line 217 of file omg.h.

Referenced by ot::dummyRestrictMatVecType1().

#define PROF_MG_RESTRICT_DUMMY_END   PetscFunctionReturn(0);
 

Definition at line 219 of file omg.h.

Referenced by ot::dummyRestrictMatVecType1().

#define PROF_MG_RESTRICT_END   PetscFunctionReturn(0);
 

Definition at line 215 of file omg.h.

Referenced by ot::restrictMatVecType1().

#define PROF_MG_SCATTER_BEGIN
 

Definition at line 209 of file omg.h.

Referenced by ot::scatterValues().

#define PROF_MG_SCATTER_END   return 0;
 

Definition at line 211 of file omg.h.

Referenced by ot::scatterValues().

#define PROF_MG_SET_DA_BEGIN   PetscFunctionBegin;
 

Definition at line 193 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_MG_SET_DA_END   PetscFunctionReturn(0);
 

Definition at line 195 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_MG_SET_KSP_BEGIN   PetscFunctionBegin;
 

Definition at line 189 of file omg.h.

Referenced by ot::DAMGSetKSP().

#define PROF_MG_SET_KSP_END   PetscFunctionReturn(0);
 

Definition at line 191 of file omg.h.

Referenced by ot::DAMGSetKSP().

#define PROF_MG_SETUP_BEGIN   PetscFunctionBegin;
 

Definition at line 197 of file omg.h.

Referenced by ot::DAMGSetUp().

#define PROF_MG_SETUP_END   PetscFunctionReturn(0);
 

Definition at line 199 of file omg.h.

Referenced by ot::DAMGSetUp().

#define PROF_PC_KSP_SHELL_APPLY_BEGIN   PetscFunctionBegin;
 

Definition at line 177 of file omg.h.

Referenced by ot::PC_KSP_Shell_Apply().

#define PROF_PC_KSP_SHELL_APPLY_END   PetscFunctionReturn(0);
 

Definition at line 179 of file omg.h.

Referenced by ot::PC_KSP_Shell_Apply().

#define PROF_PC_KSP_SHELL_DESTROY_BEGIN   PetscFunctionBegin;
 

Definition at line 173 of file omg.h.

Referenced by ot::PC_KSP_Shell_Destroy().

#define PROF_PC_KSP_SHELL_DESTROY_END   PetscFunctionReturn(0);
 

Definition at line 175 of file omg.h.

Referenced by ot::PC_KSP_Shell_Destroy().

#define PROF_PC_KSP_SHELL_SETUP_BEGIN   PetscFunctionBegin;
 

Definition at line 169 of file omg.h.

Referenced by ot::PC_KSP_Shell_SetUp().

#define PROF_PC_KSP_SHELL_SETUP_END   PetscFunctionReturn(0);
 

Definition at line 171 of file omg.h.

Referenced by ot::PC_KSP_Shell_SetUp().

#define PROF_SET_DA_STAGE1_BEGIN
 

Definition at line 151 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE1_END
 

Definition at line 152 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE2_BEGIN
 

Definition at line 154 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE2_END
 

Definition at line 155 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE3_BEGIN
 

Definition at line 157 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE3_END
 

Definition at line 158 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE4_BEGIN
 

Definition at line 160 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE4_END
 

Definition at line 161 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE5_BEGIN
 

Definition at line 163 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE5_END
 

Definition at line 164 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE6_BEGIN
 

Definition at line 166 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().

#define PROF_SET_DA_STAGE6_END
 

Definition at line 167 of file omg.h.

Referenced by ot::DAMGCreateAndSetDA().


Typedef Documentation

typedef struct _p_DAMG* ot::DAMG
 

The multigrid object

Definition at line 453 of file omg.h.

Referenced by ComputeConstVecMass(), ComputeDirichletJacobian(), ComputeDirichletLaplacian(), ComputeElasticityMat(), ComputeElasticityRHS(), ComputeFBM2_RHS(), ComputeFBM2_RHS_Part1(), ComputeFBM2_RHS_Part2(), ComputeFBM_RHS(), ComputeFBM_RHS_Part1(), ComputeFBM_RHS_Part2(), ComputeFBM_RHS_Part3(), computeInvBlockDiagEntriesForElasticityMat(), ComputeJacobian1(), ComputeJacobian2(), ComputeJacobian3(), ComputeRandomRHS(), ComputeRHS0(), ComputeRHS1(), ComputeRHS2(), ComputeRHS3(), ComputeRHS4(), ComputeRHS5(), ComputeRHS6(), ComputeRHS7(), ComputeRHS8(), ComputeRHS9(), ComputeRHS_omgNeumann(), ComputeSol(), ComputeTestFBM_RHS(), ConstVecMassMatGetDiagonal(), ConstVecMassMatMult(), CreateAndComputeFullActiveJacobian1(), CreateAndComputeFullJacobian1(), CreateAndComputeMassMatrix(), CreateConstVecMass(), CreateDirichletJacobian(), CreateDirichletLaplacian(), CreateElasticityMat(), CreateJacobian1(), CreateJacobian2(), CreateJacobian3(), CreateTmpDirichletJacobian(), CreateTmpDirichletLaplacian(), ot::DAMGCreateAndSetDA(), ot::DAMGCreateJMatrix(), ot::DAMGCreateSuppressedDOFs(), ot::DAMGDestroy(), ot::DAMGSetKSP(), DestroyDirichletJacContexts(), DestroyElasticityContexts(), DestroyUserContexts(), DirichletJacobianMatGetDiagonal(), DirichletJacobianMatMult(), DirichletJacobianShellMatMult(), DirichletLaplacianMatGetDiagonal(), DirichletLaplacianMatMult(), DirichletLaplacianShellMatMult(), ElasticityMatGetDiagonal(), ElasticityMatMult(), ElasticityShellMatMult(), EnforceZeroFBM(), EnforceZeroFBM2(), getActiveStateAndActiveCommForKSP_Shell_DirichletJac(), getActiveStateAndActiveCommForKSP_Shell_Elas(), getActiveStateAndActiveCommForKSP_Shell_Jac2or3(), getDofAndNodeSizeForElasticityMat(), getPrivateMatricesForKSP_Shell_DirichletJac(), getPrivateMatricesForKSP_Shell_Elas(), getPrivateMatricesForKSP_Shell_Jac2(), getPrivateMatricesForKSP_Shell_Jac3(), Jacobian2MatGetDiagonal(), Jacobian2MatMult(), Jacobian2ShellMatMult(), Jacobian3MatGetDiagonal(), Jacobian3MatMult(), Jacobian3ShellMatMult(), main(), SetCoarseToFineFromPts(), SetDirichletJacContexts(), SetElasticityContexts(), SetPDECoefFromPts(), SetSolutionFBM(), SetSolutionFBM2(), SetUserContexts(), SetUserContextsCoarsestToFinest(), SetUserContextsFromPts(), solve_neumann(), solve_neumann_oct(), TmpDirichletJacobianMatMult(), and TmpDirichletLaplacianMatMult().


Function Documentation

PetscErrorCode DAMGCreateJMatrix DAMG  damg,
PetscErrorCode(*)(DAMG, Mat *J)  crJ
 

This is the function used to create the J matrix. This must be called before calling DAMGSetKSP if you want to set J and B to be different. If this is not called, by default J and B will be equal.

PetscErrorCode DAMGSetKSP DAMG damg,
PetscErrorCode(*)(DAMG, Mat *B)  crjac,
PetscErrorCode(*)(DAMG, Mat J, Mat B)  computeJac,
PetscErrorCode(*)(DAMG, Vec)  rhs
 

Set function handles to create and set values in the matrices and compute the RHS.

Parameters:
damg the multigrid object
crjac function handle to the function that allocates memory for the precondition matrix at each level
computeJac function handle to the function that sets matrix entries/ setups the matrices at each level.
rhs function handle to compute the RHS vector

Referenced by main().

PetscErrorCode DAMGSetNullSpace DAMG damg,
PetscTruth  ,
int  ,
PetscErrorCode(*)(DAMG, Vec[]) 
 


Generated on Tue Mar 24 16:14:13 2009 for DENDRO by  doxygen 1.3.9.1