#include <mpi.h>#include <cstdio>#include "oda.h"#include "omg.h"#include "Point.h"#include "parUtils.h"#include "octUtils.h"#include "TreeNode.h"#include "handleStencils.h"#include <cstdlib>#include "sys.h"#include <sstream>#include "omgNeumann.h"#include "dendro.h"Go to the source code of this file.
Classes | |
| struct | Jac2MFreeData |
Defines | |
| #define | ASSIGN_MAT_PROP_FINE_TO_COARSE_ELEM_BLOCK |
| #define | BUILD_FULL_JAC_TYPE2_BLOCK(B) |
| #define | CHK_AND_SCATTER_FINE_TO_COARSE_BLOCK |
| #define | FINE_TO_COARSE_BLOCK |
| #define | JAC_TYPE2_DIAG_BLOCK |
| #define | JAC_TYPE2_ELEM_DIAG_BLOCK |
| #define | JAC_TYPE2_ELEM_MULT_BLOCK |
| #define | JAC_TYPE2_MULT_BLOCK |
Functions | |
| void | CalculateCenters (ot::DA *da, std::vector< double > ¢ers) |
| PetscErrorCode | ComputeJacobian2 (ot::DAMG damg, Mat J, Mat B) |
| PetscErrorCode | ComputeRHS_omgNeumann (ot::DAMG damg, Vec in) |
| PetscErrorCode | CreateJacobian2 (ot::DAMG damg, Mat *jac) |
| void | DestroyUserContexts (ot::DAMG *damg) |
| void | getActiveStateAndActiveCommForKSP_Shell_Jac2or3 (Mat mat, bool &activeState, MPI_Comm &activeComm) |
| void | getPrivateMatricesForKSP_Shell_Jac2 (Mat mat, Mat *AmatPrivate, Mat *PmatPrivate, MatStructure *pFlag) |
| PetscErrorCode | Jacobian2MatDestroy (Mat J) |
| PetscErrorCode | Jacobian2MatGetDiagonal (Mat J, Vec diag) |
| PetscErrorCode | Jacobian2MatMult (Mat J, Vec in, Vec out) |
| PetscErrorCode | Jacobian2ShellMatMult (Mat J, Vec in, Vec out) |
| void | SetPDECoefFromPts (ot::DAMG *damg, const std::vector< double > ¢ers, void(*CalcCoef)(const std::vector< double > &pts, std::vector< double > &values)) |
| void | solve_neumann (std::vector< double > &pts, void(*CalcCoef)(const std::vector< double > &pts, std::vector< double > &values), void(*CalcRHS)(const std::vector< double > &pts, std::vector< double > &values), int numMultigridLevels, Vec &sol, ot::DAMG *&damg) |
| This function calculates the approximate solution to the scalar equation -div(alpha*grad u) + beta * u = f in the unit cube subject to homogeneous Neumann boundary conditions. | |
| void | solve_neumann_oct (std::vector< ot::TreeNode > &octs, void(*CalcCoef)(const std::vector< double > &pts, std::vector< double > &values), void(*CalcRHS)(const std::vector< double > &pts, std::vector< double > &values), int numMultigridLevels, Vec &sol, ot::DAMG *&damg) |
| This function calculates the approximate solution to the scalar equation -div(alpha*grad u) + beta * u = f in the unit cube subject to homogeneous Neumann boundary conditions. | |
Variables | |
| std::vector< double > | force_values |
| double **** | LaplacianType2Stencil |
| double **** | MassType2Stencil |
| double *** | RHSType2Stencil |
Definition in file omgNeumann.C.
|
|
Definition at line 73 of file omgNeumann.C. |
|
|
Definition at line 560 of file omgNeumann.C. |
|
|
Definition at line 40 of file omgNeumann.C. |
|
|
Definition at line 115 of file omgNeumann.C. |
|
|
Value: {\
ot::DA* da = damg->da;\
iC(VecZeroEntries(diag));\
double *matPropArr;\
/*Elem,Ghost,Read-only,1 dof*/\
da->vecGetBuffer<double>(*(data->matProp),matPropArr,true,true,true,2);\
PetscScalar *diagArr;\
/*Nodal,Non-Ghosted,Write,1 dof*/\
da->vecGetBuffer(diag,diagArr,false,false,false,1);\
unsigned int maxD;\
double hFac;\
if(da->iAmActive()) {\
maxD = (da->getMaxDepth());\
hFac = 1.0/((double)(1u << (maxD-1)));\
/*Loop through All Elements including ghosted*/\
for(da->init<ot::DA_FLAGS::ALL>(); da->curr() < da->end<ot::DA_FLAGS::ALL>(); da->next<ot::DA_FLAGS::ALL>()) {\
JAC_TYPE2_ELEM_DIAG_BLOCK\
} /*end i*/\
} /*end if active*/\
da->vecRestoreBuffer<double>(*(data->matProp),matPropArr,true,true,true,2);\
da->vecRestoreBuffer(diag,diagArr,false,false,false,1);\
PetscLogFlops(44*(da->getGhostedElementSize()));\
}
Definition at line 416 of file omgNeumann.C. |
|
|
Value: {\
unsigned int idx = da->curr();\
unsigned int lev = da->getLevel(idx);\
double h = hFac*(1u << (maxD - lev));\
double matP1 = matPropArr[2*idx];\
double matP2 = matPropArr[2*idx+1];\
double fac1 = matP1*h/2.0;\
double fac2 = matP2*h*h*h/8.0;\
unsigned int indices[8];\
da->getNodeIndices(indices);\
unsigned char childNum = da->getChildNumber();\
unsigned char hnMask = da->getHangingNodeIndex(idx);\
unsigned char elemType = 0;\
GET_ETYPE_BLOCK(elemType,hnMask,childNum)\
for(int k = 0; k < 8; k++) {\
diagArr[indices[k]] += ((fac1*(LaplacianType2Stencil[childNum][elemType][k][k])) +\
(fac2*(MassType2Stencil[childNum][elemType][k][k])));\
} /*end k*/\
}
Definition at line 396 of file omgNeumann.C. |
|
|
Value: {\
unsigned int idx = da->curr();\
unsigned int lev = da->getLevel(idx);\
double h = hFac*(1u << (maxD - lev));\
double matP1 = matPropArr[2*idx];\
double matP2 = matPropArr[2*idx+1];\
double fac1 = matP1*h/2.0;\
double fac2 = matP2*h*h*h/8.0;\
unsigned int indices[8];\
da->getNodeIndices(indices);\
unsigned char childNum = da->getChildNumber();\
unsigned char hnMask = da->getHangingNodeIndex(idx);\
unsigned char elemType = 0;\
GET_ETYPE_BLOCK(elemType,hnMask,childNum)\
for(int k = 0;k < 8;k++) {\
for(int j=0;j<8;j++) {\
outArr[indices[k]] += (((fac1*(LaplacianType2Stencil[childNum][elemType][k][j])) +\
(fac2*(MassType2Stencil[childNum][elemType][k][j])))*inArr[indices[j]]);\
}/*end for j*/\
}/*end for k*/\
}
Definition at line 468 of file omgNeumann.C. |
|
|
Definition at line 491 of file omgNeumann.C. |
|
||||||||||||
|
Definition at line 788 of file omgNeumann.C. References ot::DA::createVector(), ot::DA::curr(), ot::DA::end(), ot::DA::getCurrentOffset(), ot::DA::getLevel(), ot::DA::getMaxDepth(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), Point::xint(), Point::yint(), and Point::zint(). Referenced by solve_neumann(), and solve_neumann_oct(). |
|
||||||||||||||||
|
Definition at line 616 of file omgNeumann.C. References BUILD_FULL_JAC_TYPE2_BLOCK, ot::DAMG, Jac2MFreeData::Jmat_private, and ot::_p_DAMG::user. Referenced by solve_neumann(), and solve_neumann_oct(). |
|
||||||||||||
|
Definition at line 749 of file omgNeumann.C. References ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), force_values, GET_ETYPE_BLOCK, ot::DA::getChildNumber(), ot::DA::getHangingNodeIndex(), ot::DA::getLevel(), ot::DA::getNodeIndices(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), RHSType2Stencil, ot::DA::vecGetBuffer(), and ot::DA::vecRestoreBuffer(). Referenced by solve_neumann(), and solve_neumann_oct(). |
|
||||||||||||
|
|
Definition at line 300 of file omgNeumann.C. References ot::DAMG, Jac2MFreeData::inTmp, Jac2MFreeData::Jmat_private, Jac2MFreeData::matProp, ot::_p_DAMG::nlevels, Jac2MFreeData::outTmp, and ot::_p_DAMG::user. Referenced by main(), solve_neumann(), and solve_neumann_oct(). |
|
||||||||||||||||
|
Definition at line 357 of file omgNeumann.C. References ot::_p_DAMG::da, ot::DAMG, ot::DA::getCommActive(), and ot::DA::iAmActive(). |
|
||||||||||||||||||||
|
Definition at line 370 of file omgNeumann.C. References ot::DAMG, and Jac2MFreeData::Jmat_private. |
|
|
Definition at line 387 of file omgNeumann.C. Referenced by CreateJacobian2(). |
|
||||||||||||
|
Definition at line 442 of file omgNeumann.C. References ot::DAMG, iC, Jac2MFreeData::isFinestLevel, and JAC_TYPE2_DIAG_BLOCK. Referenced by CreateJacobian2(). |
|
||||||||||||||||
|
Definition at line 533 of file omgNeumann.C. References ot::DAMG, iC, Jac2MFreeData::isFinestLevel, and JAC_TYPE2_MULT_BLOCK. Referenced by CreateJacobian2(). |
|
||||||||||||||||
|
Definition at line 324 of file omgNeumann.C. References ot::DAMG, Jac2MFreeData::inTmp, Jac2MFreeData::Jmat_private, and Jac2MFreeData::outTmp. Referenced by CreateJacobian2(). |
|
||||||||||||||||
|
Definition at line 188 of file omgNeumann.C. References CHK_AND_SCATTER_FINE_TO_COARSE_BLOCK, ot::DA::createVector(), ot::DA::curr(), ot::_p_DAMG::da, ot::DAMG, ot::DA::end(), FINE_TO_COARSE_BLOCK, ot::DA::getCommActive(), ot::DA::iAmActive(), ot::DA::init(), ot::DA::next(), ot::_p_DAMG::nlevels, ot::_p_DAMG::user, ot::DA::vecGetBuffer(), and ot::DA::vecRestoreBuffer(). Referenced by solve_neumann(), and solve_neumann_oct(). |
|
||||||||||||||||||||||||||||
|
This function calculates the approximate solution to the scalar equation -div(alpha*grad u) + beta * u = f in the unit cube subject to homogeneous Neumann boundary conditions.
Definition at line 832 of file omgNeumann.C. References ot::balanceOctree(), CalculateCenters(), ComputeJacobian2(), ComputeRHS_omgNeumann(), CreateJacobian2(), createLmatType2(), createMmatType2(), createRHSType2(), ot::DAMG, ot::DAMGCreateAndSetDA(), DAMGGetx, ot::DAMGSetKSP(), ot::DAMGSolve(), DendroIntL, destroyLmatType2(), destroyMmatType2(), destroyRHSType2(), DestroyUserContexts(), force_values, LaplacianType2Stencil, MassType2Stencil, ot::points2Octree(), RHSType2Stencil, and SetPDECoefFromPts(). Referenced by main(). |
|
||||||||||||||||||||||||||||
|
This function calculates the approximate solution to the scalar equation -div(alpha*grad u) + beta * u = f in the unit cube subject to homogeneous Neumann boundary conditions.
Definition at line 949 of file omgNeumann.C. References ot::balanceOctree(), CalculateCenters(), ot::completeOctree(), ComputeJacobian2(), ComputeRHS_omgNeumann(), CreateJacobian2(), createLmatType2(), createMmatType2(), createRHSType2(), ot::DAMG, ot::DAMGCreateAndSetDA(), DAMGGetx, ot::DAMGSetKSP(), ot::DAMGSolve(), DendroIntL, destroyLmatType2(), destroyMmatType2(), destroyRHSType2(), DestroyUserContexts(), force_values, ot::DA::getMaxDepth(), LaplacianType2Stencil, MassType2Stencil, RHSType2Stencil, and SetPDECoefFromPts(). Referenced by main(). |
|
|
Definition at line 30 of file omgNeumann.C. Referenced by ComputeRHS_omgNeumann(), solve_neumann(), and solve_neumann_oct(). |
|
|
Definition at line 27 of file omgNeumann.C. |
|
|
Definition at line 28 of file omgNeumann.C. |
|
|
Definition at line 29 of file omgNeumann.C. Referenced by ComputeRHS_omgNeumann(), solve_neumann(), and solve_neumann_oct(). |
1.3.9.1