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

omgRhs.C File Reference

#include "petsc.h"
#include "parUtils.h"
#include "seqUtils.h"
#include "omg.h"
#include "oda.h"
#include "odaJac.h"
#include "omgJac.h"
#include "nodeAndValues.h"

Go to the source code of this file.

Namespaces

namespace  ot

Defines

#define EVAL_FN(x, y, z, result)
#define square(x)   ((x)*(x))

Functions

double ComputeError5 (ot::DA *da, Vec in)
PetscErrorCode ComputeFBM2_RHS (ot::DAMG damg, Vec in)
PetscErrorCode ComputeFBM2_RHS_Part1 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeFBM2_RHS_Part2 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeFBM_RHS (ot::DAMG damg, Vec in)
PetscErrorCode ComputeFBM_RHS_Part1 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeFBM_RHS_Part2 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeFBM_RHS_Part3 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRandomRHS (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS0 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS1 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS2 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS3 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS4 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS5 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS6 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS7 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS8 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeRHS9 (ot::DAMG damg, Vec in)
PetscErrorCode ComputeSol (ot::DAMG damg, Vec expectedSol)
PetscErrorCode ComputeTestFBM_RHS (ot::DAMG damg, Vec in)
PetscErrorCode EnforceZeroFBM (ot::DAMG damg, Vec tmp)
PetscErrorCode EnforceZeroFBM2 (ot::DAMG damg, Vec tmp)
PetscErrorCode SetSolution5 (ot::DA *da, Vec tmp)
PetscErrorCode SetSolutionFBM (ot::DAMG damg, Vec tmp)
PetscErrorCode SetSolutionFBM2 (ot::DAMG damg, Vec tmp)
double TestError5 (ot::DA *da)

Variables

double ****** ShapeFnStencil


Detailed Description

Author:
Rahul Sampath, rahul.sampath@gmail.com

Definition in file omgRhs.C.


Define Documentation

#define EVAL_FN x,
y,
z,
result   ) 
 

Value:

{\
  result = 0.0;\
  if( ((x) >= 0.0) && ((y) >= 0.0) && ((z) >= 0.0) && \
      ((x) < 0.2) && ((y) < 0.2) && ((z) < 0.2) ) {\
    double dx = ((x) - 0.1);\
    double dy = ((y) - 0.1);\
    double dz = ((z) - 0.1);\
    result += exp(-((square(dx) + square(dy) + square(dz))/0.005));\
  }\
  if( ((x) >= 0.2) && ((y) >= 0.2) && ((z) >= 0.2) && \
      ((x) <= 0.4) && ((y) <= 0.4) && ((z) <= 0.4) ) {\
    double dx = ((x) - 0.3);\
    double dy = ((y) - 0.3);\
    double dz = ((z) - 0.3);\
    result += exp(-((square(dx) + square(dy) + square(dz))/0.005));\
  }\
  if( ((x) >= 0.5) && ((y) >= 0.5) && ((z) >= 0.5) && \
      ((x) <= 0.7) && ((y) <= 0.7) && ((z) <= 0.7) ) {\
    double dx = ((x) - 0.6);\
    double dy = ((y) - 0.6);\
    double dz = ((z) - 0.6);\
    result += exp(-((square(dx) + square(dy) + square(dz))/0.005));\
  }\
}

Definition at line 24 of file omgRhs.C.

Referenced by ComputeRHS2().

#define square  )     ((x)*(x))
 

Definition at line 22 of file omgRhs.C.

Referenced by ComputeFBM2_RHS_Part1(), ComputeFBM_RHS_Part1(), ComputeFBM_RHS_Part3(), EnforceZeroFBM(), and SetSolutionFBM().


Function Documentation

double ComputeError5 ot::DA da,
Vec  in
 

Definition at line 1832 of file omgRhs.C.

References ot::DA::curr(), ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getCommActive(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::ReadFromGhostsBegin(), ot::DA::ReadFromGhostsEnd(), ShapeFnStencil, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by main(), and TestError5().

PetscErrorCode ComputeFBM2_RHS ot::DAMG  damg,
Vec  in
 

Definition at line 333 of file omgRhs.C.

References ot::_p_DAMG::comm, ComputeFBM2_RHS_Part1(), ComputeFBM2_RHS_Part2(), CreateTmpDirichletLaplacian(), and ot::DAMG.

Referenced by main().

PetscErrorCode ComputeFBM2_RHS_Part1 ot::DAMG  damg,
Vec  in
 

Definition at line 373 of file omgRhs.C.

References DirichletJacData::bdyArr, ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getComm(), ot::DA::getCurrentOffset(), ot::DA::getDimension(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), ot::DA::getNodeIndices(), ot::DA::getNpesActive(), ot::DA::getNpesAll(), ot::DA::getRankAll(), ot::DA::iAmActive(), ot::DA::init(), ot::TreeNode::isAncestor(), ot::DA::next(), sort(), par::splitComm2way(), square, ot::_p_DAMG::user, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), ot::DA::WriteToGhostsEnd(), Point::xint(), Point::yint(), and Point::zint().

Referenced by ComputeFBM2_RHS().

PetscErrorCode ComputeFBM2_RHS_Part2 ot::DAMG  damg,
Vec  in
 

Definition at line 602 of file omgRhs.C.

References DirichletJacData::bdyArr, ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::_p_DAMG::user, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by ComputeFBM2_RHS().

PetscErrorCode ComputeFBM_RHS ot::DAMG  damg,
Vec  in
 

Definition at line 666 of file omgRhs.C.

References ot::_p_DAMG::comm, ComputeFBM_RHS_Part1(), ComputeFBM_RHS_Part2(), ComputeFBM_RHS_Part3(), CreateTmpDirichletJacobian(), and ot::DAMG.

Referenced by main().

PetscErrorCode ComputeFBM_RHS_Part1 ot::DAMG  damg,
Vec  in
 

Definition at line 990 of file omgRhs.C.

References DirichletJacData::bdyArr, ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), square, ot::_p_DAMG::user, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by ComputeFBM_RHS(), and ComputeTestFBM_RHS().

PetscErrorCode ComputeFBM_RHS_Part2 ot::DAMG  damg,
Vec  in
 

Definition at line 773 of file omgRhs.C.

References DirichletJacData::bdyArr, ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getComm(), ot::DA::getCurrentOffset(), ot::DA::getDimension(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), ot::DA::getNodeIndices(), ot::DA::getNpesActive(), ot::DA::getNpesAll(), ot::DA::getRankAll(), ot::DA::iAmActive(), ot::DA::init(), ot::TreeNode::isAncestor(), ot::DA::next(), ot::readPtsFromFile(), sort(), par::splitComm2way(), ot::_p_DAMG::user, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), ot::DA::WriteToGhostsEnd(), Point::xint(), Point::yint(), and Point::zint().

Referenced by ComputeFBM_RHS().

PetscErrorCode ComputeFBM_RHS_Part3 ot::DAMG  damg,
Vec  in
 

Definition at line 705 of file omgRhs.C.

References DirichletJacData::bdyArr, ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), square, ot::_p_DAMG::user, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by ComputeFBM_RHS(), and ComputeTestFBM_RHS().

PetscErrorCode ComputeRandomRHS ot::DAMG  damg,
Vec  in
 

Definition at line 1262 of file omgRhs.C.

References ot::_p_DAMG::comm, and ot::DAMG.

Referenced by ComputeRHS3(), and ComputeRHS4().

PetscErrorCode ComputeRHS0 ot::DAMG  damg,
Vec  in
 

Definition at line 1256 of file omgRhs.C.

References ot::DAMG.

PetscErrorCode ComputeRHS1 ot::DAMG  damg,
Vec  in
 

Definition at line 1340 of file omgRhs.C.

References ot::_p_DAMG::comm, CreateAndComputeMassMatrix(), ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeRHS2 ot::DAMG  damg,
Vec  in
 

Definition at line 1127 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), EVAL_FN, GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ShapeFnStencil, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeRHS3 ot::DAMG  damg,
Vec  in
 

Definition at line 1292 of file omgRhs.C.

References ot::_p_DAMG::comm, ComputeRandomRHS(), CreateAndComputeMassMatrix(), ot::_p_DAMG::da, and ot::DAMG.

PetscErrorCode ComputeRHS4 ot::DAMG  damg,
Vec  in
 

Definition at line 1317 of file omgRhs.C.

References ot::_p_DAMG::comm, ComputeRandomRHS(), ot::DAMG, and ot::_p_DAMG::J.

Referenced by main().

PetscErrorCode ComputeRHS5 ot::DAMG  damg,
Vec  in
 

Definition at line 1432 of file omgRhs.C.

References ot::_p_DAMG::comm, CreateAndComputeMassMatrix(), ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeRHS6 ot::DAMG  damg,
Vec  in
 

RHS assembled by multiplying the J matrix with the solution

Definition at line 1530 of file omgRhs.C.

References ot::_p_DAMG::da, ot::DAMG, ot::_p_DAMG::J, and SetSolution5().

PetscErrorCode ComputeRHS7 ot::DAMG  damg,
Vec  in
 

RHS corresponding to the homogeneous neumann, variable coefficient, scalar, poisson problem with solution = cos(2*pi*x)cos(2*pi*y)cos(2*pi*z) and epsilon = 1 + 10^6[cos^2(2*pi*x) + cos^2(2*pi*y) + cos^2(2*pi*z)] and alpha = 1 This is the same as RHStypes 5 and 6. It is only assembled differently. Rhs is assembled using 3-pt gauss-quadrature integration per dimension. This is exact to polynomials of degree 5 or less w1 =8/9, x1 =0, w2=w3 =5/9, x2 = +sqrt(3/5), x3 = -sqrt(3/5) int_a_to_b(f) = ((b-a)/2)*sum(wi*f((((b-a)/2)*xi) + ((b+a)/2)))

Definition at line 1552 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ShapeFnStencil, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeRHS8 ot::DAMG  damg,
Vec  in
 

RHS corresponding to the homogeneous neumann, variable coefficient, scalar, poisson problem with solution = cos(2*pi*x)cos(2*pi*y)cos(2*pi*z) and epsilon = 1 + 10^6[cos^2(2*pi*x) + cos^2(2*pi*y) + cos^2(2*pi*z)] and alpha = 1 This is the same as RHStypes 5, 6 and 7. It is only assembled differently. Rhs is assembled using arbitrary order(>=2 and <=7) gauss-quadrature integration per dimension. This is exact to polynomials of degree 5 or less w1 =8/9, x1 =0, w2=w3 =5/9, x2 = +sqrt(3/5), x3 = -sqrt(3/5) int_a_to_b(f) = ((b-a)/2)*sum(wi*f((((b-a)/2)*xi) + ((b+a)/2)))

Definition at line 1638 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeRHS9 ot::DAMG  damg,
Vec  in
 

Definition at line 1904 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getComm(), ot::DA::getCurrentOffset(), ot::DA::getDimension(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getMinAllBlocks(), ot::DA::getNodeIndices(), ot::DA::getNpesActive(), ot::DA::getNpesAll(), ot::DA::getRankAll(), ot::DA::iAmActive(), ot::DA::init(), ot::TreeNode::isAncestor(), ot::DA::next(), sort(), par::splitComm2way(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), ot::DA::WriteToGhostsBegin(), ot::DA::WriteToGhostsEnd(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeSol ot::DAMG  damg,
Vec  expectedSol
 

Definition at line 1196 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

PetscErrorCode ComputeTestFBM_RHS ot::DAMG  damg,
Vec  in
 

Definition at line 302 of file omgRhs.C.

References ot::_p_DAMG::comm, ComputeFBM_RHS_Part1(), ComputeFBM_RHS_Part3(), CreateTmpDirichletJacobian(), and ot::DAMG.

Referenced by main().

PetscErrorCode EnforceZeroFBM ot::DAMG  damg,
Vec  tmp
 

Definition at line 110 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), square, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by main().

PetscErrorCode EnforceZeroFBM2 ot::DAMG  damg,
Vec  tmp
 

Definition at line 49 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by main().

PetscErrorCode SetSolution5 ot::DA da,
Vec  tmp
 

Sets cos(2*pi*x)cos(2*pi*y)cos(2*pi*z) at the node values

Definition at line 1773 of file omgRhs.C.

References ot::DA::curr(), ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by ComputeRHS6(), and TestError5().

PetscErrorCode SetSolutionFBM ot::DAMG  damg,
Vec  tmp
 

Definition at line 237 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), square, ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by main().

PetscErrorCode SetSolutionFBM2 ot::DAMG  damg,
Vec  tmp
 

Definition at line 174 of file omgRhs.C.

References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::DA::vecGetBuffer(), ot::DA::vecRestoreBuffer(), Point::xint(), Point::yint(), and Point::zint().

Referenced by main().

double TestError5 ot::DA da  ) 
 

Definition at line 1892 of file omgRhs.C.

References ComputeError5(), ot::DA::createVector(), and SetSolution5().

Referenced by main().


Variable Documentation

double****** ShapeFnStencil
 

Definition at line 46 of file checkError.C.

Referenced by ComputeError5(), ComputeRHS2(), ComputeRHS7(), and main().


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