Public Member Functions | |
TypeName ("DAJacCon") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, DAJacCon, dictionary,(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex),(modelType, mesh, daOption, daModel, daIndex)) | |
DAJacCon (const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex) | |
virtual | ~DAJacCon () |
virtual void | clear ()=0 |
clear members in parent and child objects More... | |
virtual void | setupJacConPreallocation (const dictionary &options) |
calculate the preallocation vector for initializing the JacCon mat, if necessary More... | |
virtual void | initializeJacCon (const dictionary &options)=0 |
initialize the state Jacobian connectivity matrix More... | |
virtual void | setupJacCon (const dictionary &options)=0 |
assign 1 to all non-zero elements for the Jacobian connecitivyt matrix More... | |
label | getNJacConColors () const |
get the number of JacCon colors More... | |
virtual void | preallocatedRdW (Mat dRMat, const label transposed) const |
preallocate dRdW matrix using the preallocVec More... | |
void | calcJacConColoring (const word postFix="") |
compute graph coloring for Jacobian connectivity matrix More... | |
void | readJacConColoring (const word postFix="") |
read colors for JacCon More... | |
label | coloringExists (const word postFix="") const |
whether the coloring file exists More... | |
Vec | getJacConColor () const |
return DAJacCon::jacConColors_ More... | |
void | calcColoredColumns (const label colorI, Vec coloredColumn) const |
calculate the colored column vector More... | |
virtual void | setObjFuncVec (scalarList objFuncFaceValues, scalarList objFuncCellValues, Vec objFuncVec) const |
assign values for the objective function vector based on the face and cell value lists More... | |
Static Public Member Functions | |
static autoPtr< DAJacCon > | New (const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex) |
Protected Member Functions | |
void | initializeStateBoundaryCon () |
initialize state boundary connection More... | |
void | calcNeiBFaceGlobalCompact (labelList &neiBFaceGlobalCompact) |
calculate DAJacCon::neiBFaceGlobalCompact_ More... | |
label | getLocalCoupledBFaceIndex (const label localFaceI) const |
given a local face index, return the local index of the coupled boundary face More... | |
void | setupStateBoundaryCon (Mat *stateBoundaryCon) |
calculate DAJacCon::stateBoundaryCon_ More... | |
void | setupStateBoundaryConID (Mat *stateBoundaryConID) |
calculate DAJacCon::stateBoundaryConID_ More... | |
void | createConnectionMat (Mat *connectedStates) |
allocate connectedState matrix More... | |
void | addStateConnections (Mat connections, const label cellI, const label connectedLevelLocal, const wordList connectedStatesLocal, const List< List< word >> connectedStateInterProc, const label addFace) |
a high-level function to add connected state column indices to the connectivity matrix More... | |
void | setConnections (Mat conMat, const label idx) const |
add value 1 for the colume idx to conMat More... | |
void | setupJacobianConnections (Mat conMat, Mat connections, const label idxI) |
assign values in connections to a specific row idxI in conMat More... | |
void | combineStateBndCon (Mat *stateBoundaryCon, Mat *stateBoundaryConTmp) |
combine stateBoundaryCon and stateBoundaryConTmp, this is to ensure including all connected states for parallel cases More... | |
void | addConMatCell (Mat conMat, const label gRow, const label cellI, const word stateName, const PetscScalar val) |
add val to the gRow row in conMat, the column indice are the state (given by stateName) for a given cellI More... | |
void | addConMatNeighbourCells (Mat conMat, const label gRow, const label cellI, const word stateName, const PetscScalar val) |
add val to gRow row in conMat, column indice are the neighbouring states (given by stateName) for a given cellI More... | |
void | addConMatCellFaces (Mat conMat, const label gRow, const label cellI, const word stateName, const PetscScalar val) |
add val to gRow row in conMat, column indice are the faces (given by stateName) for a given cellI More... | |
void | addBoundaryFaceConnections (Mat conMat, const label gRow, const label cellI, const labelList v, const List< List< word >> connectedStates, const label addFaces) |
add the column index of the (iner-proc) connected states and faces to conMat, given a local face index More... | |
void | clearDAJacConMembers () |
clear members in DAJacCon More... | |
void | checkSpecialBCs () |
check if there is special boundary conditions that need special treatment in jacCon_ More... | |
void | setPIVVec (Vec iSPIV, const label idxI) |
function used to add connectivity for pressureInletVelocity More... | |
label | addPhi4PIV (const word stateName, const label idxI, const label comp=-1) |
add connectivity phi for pressureInletVelocity More... | |
Protected Attributes | |
const word | modelType_ |
the name of the jacCon matrix More... | |
const fvMesh & | mesh_ |
fvMesh More... | |
const DAOption & | daOption_ |
DAOption object. More... | |
const DAModel & | daModel_ |
DAModel object. More... | |
const DAIndex & | daIndex_ |
DAIndex object. More... | |
DAColoring | daColoring_ |
DAColoring object. More... | |
DAField | daField_ |
DAField object. More... | |
HashTable< wordList > | stateInfo_ |
the regState_ list from DAStateInfo object More... | |
Mat | stateBoundaryCon_ |
matrix to store boundary connectivity levels for state Jacobians More... | |
Mat | stateBoundaryConID_ |
matrix to store boundary connectivity ID for state Jacobians More... | |
labelList | neiBFaceGlobalCompact_ |
neibough face global index for a given local boundary face More... | |
Mat | jacCon_ |
Jacobian connectivity mat. More... | |
Vec | jacConColors_ |
jacCon matrix colors More... | |
label | nJacConColors_ |
number of jacCon colors More... | |
Vec | isPIVBCState_ |
a vector to show whether a state is connected to a pressureInletVelocity boundary face (3 level max) More... | |
Definition at line 34 of file DAJacCon.H.
DAJacCon | ( | const word | modelType, |
const fvMesh & | mesh, | ||
const DAOption & | daOption, | ||
const DAModel & | daModel, | ||
const DAIndex & | daIndex | ||
) |
Definition at line 22 of file DAJacCon.C.
References DAJacCon::checkSpecialBCs(), daModel(), daOption(), mesh, DAStateInfo::New(), solverName, and DAJacCon::stateInfo_.
|
inlinevirtual |
Definition at line 233 of file DAJacCon.H.
|
protected |
initialize state boundary connection
Definition at line 88 of file DAJacCon.C.
References DAJacCon::calcNeiBFaceGlobalCompact(), DAJacCon::daOption_, DAOption::getAllOptions(), DAOption::getOption(), DAJacCon::neiBFaceGlobalCompact_, DAJacCon::setupStateBoundaryCon(), DAJacCon::setupStateBoundaryConID(), DAJacCon::stateBoundaryCon_, DAJacCon::stateBoundaryConID_, and DAUtility::writeMatrixBinary().
Referenced by DAJacCondFdW::DAJacCondFdW(), and DAJacCondRdW::DAJacCondRdW().
|
protected |
calculate DAJacCon::neiBFaceGlobalCompact_
Definition at line 570 of file DAJacCon.C.
References DAJacCon::daIndex_, forAll(), DAIndex::globalCoupledBFaceNumbering, DAJacCon::mesh_, DAIndex::nLocalBoundaryFaces, and DAIndex::nLocalInternalFaces.
Referenced by DAJacCon::initializeStateBoundaryCon().
|
protected |
given a local face index, return the local index of the coupled boundary face
Definition at line 637 of file DAJacCon.C.
References forAll(), and DAJacCon::mesh_.
Referenced by DAJacCon::addBoundaryFaceConnections(), and DAJacCondRdW::setupdRdWCon().
|
protected |
calculate DAJacCon::stateBoundaryCon_
Definition at line 684 of file DAJacCon.C.
References DAJacCon::addBoundaryFaceConnections(), DAJacCon::addConMatCell(), DAJacCon::addConMatCellFaces(), DAJacCon::addConMatNeighbourCells(), DAIndex::adjStateNames, DAIndex::adjStateType, DAJacCon::combineStateBndCon(), DAJacCon::daIndex_, forAll(), DAJacCon::mesh_, DAJacCon::neiBFaceGlobalCompact_, DAIndex::nLocalAdjointStates, DAIndex::nLocalCoupledBFaces, DAIndex::nLocalInternalFaces, and DAJacCon::stateInfo_.
Referenced by DAJacCon::initializeStateBoundaryCon().
|
protected |
calculate DAJacCon::stateBoundaryConID_
Definition at line 1327 of file DAJacCon.C.
References DAIndex::calcAdjStateID4GlobalAdjIdx(), DAJacCon::daIndex_, DAUtility::isValueCloseToRef(), DAIndex::nGlobalAdjointStates, DAIndex::nLocalAdjointStates, DAIndex::nLocalCoupledBFaces, DAJacCon::stateBoundaryCon_, and dafoam_plot3dtransform::vals.
Referenced by DAJacCon::initializeStateBoundaryCon().
|
protected |
allocate connectedState matrix
Definition at line 161 of file DAJacCon.C.
References DAJacCon::daIndex_, and DAIndex::nGlobalAdjointStates.
Referenced by DAJacCondRdW::setupdRdWCon(), and DAJacCondFdW::setupJacCon().
|
protected |
a high-level function to add connected state column indices to the connectivity matrix
Definition at line 188 of file DAJacCon.C.
References DAJacCon::addBoundaryFaceConnections(), DAJacCon::addConMatCellFaces(), DAJacCon::addConMatNeighbourCells(), DAIndex::adjStateType, DAJacCon::daIndex_, forAll(), DAIndex::getGlobalAdjointStateIndex(), DAJacCon::mesh_, DAJacCon::setConnections(), and DAJacCon::stateInfo_.
Referenced by DAJacCondRdW::setupdRdWCon(), and DAJacCondFdW::setupJacCon().
|
protected |
add value 1 for the colume idx to conMat
Definition at line 553 of file DAJacCon.C.
Referenced by DAJacCon::addStateConnections(), and DAJacCondRdW::setupdRdWCon().
|
protected |
assign values in connections to a specific row idxI in conMat
Definition at line 126 of file DAJacCon.C.
References dafoam_plot3dtransform::vals.
Referenced by DAJacCondRdW::setupdRdWCon(), and DAJacCondFdW::setupJacCon().
|
protected |
combine stateBoundaryCon and stateBoundaryConTmp, this is to ensure including all connected states for parallel cases
Definition at line 1091 of file DAJacCon.C.
References DAJacCon::addBoundaryFaceConnections(), DAJacCon::daIndex_, forAll(), k, DAJacCon::mesh_, DAJacCon::neiBFaceGlobalCompact_, DAIndex::nLocalAdjointStates, DAIndex::nLocalCoupledBFaces, DAIndex::nLocalInternalFaces, and dafoam_plot3dtransform::vals.
Referenced by DAJacCon::setupStateBoundaryCon().
|
protected |
add val to the gRow row in conMat, the column indice are the state (given by stateName) for a given cellI
Definition at line 1393 of file DAJacCon.C.
References DAIndex::adjStateType, DAJacCon::daIndex_, and DAIndex::getGlobalAdjointStateIndex().
Referenced by DAJacCon::setupStateBoundaryCon().
|
protected |
add val to gRow row in conMat, column indice are the neighbouring states (given by stateName) for a given cellI
Definition at line 1452 of file DAJacCon.C.
References DAIndex::adjStateType, DAJacCon::daIndex_, forAll(), DAIndex::getGlobalAdjointStateIndex(), and DAJacCon::mesh_.
Referenced by DAJacCon::addStateConnections(), and DAJacCon::setupStateBoundaryCon().
|
protected |
add val to gRow row in conMat, column indice are the faces (given by stateName) for a given cellI
Definition at line 1521 of file DAJacCon.C.
References DAJacCon::daIndex_, forAll(), DAIndex::getGlobalAdjointStateIndex(), and DAJacCon::mesh_.
Referenced by DAJacCon::addStateConnections(), and DAJacCon::setupStateBoundaryCon().
|
protected |
add the column index of the (iner-proc) connected states and faces to conMat, given a local face index
Definition at line 1577 of file DAJacCon.C.
References DAIndex::adjStateID, DAJacCon::daIndex_, forAll(), DAJacCon::getLocalCoupledBFaceIndex(), DAIndex::globalCoupledBFaceNumbering, DAIndex::isCoupledFace, DAJacCon::mesh_, DAJacCon::stateBoundaryCon_, DAJacCon::stateBoundaryConID_, and dafoam_plot3dtransform::vals.
Referenced by DAJacCon::addStateConnections(), DAJacCon::combineStateBndCon(), and DAJacCon::setupStateBoundaryCon().
|
inlineprotected |
clear members in DAJacCon
Definition at line 164 of file DAJacCon.H.
References DAJacCon::jacCon_, DAJacCon::jacConColors_, DAJacCon::neiBFaceGlobalCompact_, DAJacCon::stateBoundaryCon_, DAJacCon::stateBoundaryConID_, and DAJacCon::stateInfo_.
Referenced by DAJacCondFdW::clear(), and DAJacCondRdW::clear().
|
protected |
check if there is special boundary conditions that need special treatment in jacCon_
Definition at line 2083 of file DAJacCon.C.
References DAJacCon::daField_, DAJacCon::daIndex_, DAJacCon::daOption_, forAll(), DAOption::getAllOptions(), DAJacCon::isPIVBCState_, DAJacCon::mesh_, DAIndex::nLocalAdjointStates, DAJacCon::setPIVVec(), DAField::specialBCs, U, and DAUtility::writeVectorASCII().
Referenced by DAJacCon::DAJacCon().
|
protected |
function used to add connectivity for pressureInletVelocity
Definition at line 2164 of file DAJacCon.C.
References DAIndex::adjStateNames, DAIndex::adjStateType, DAJacCon::daIndex_, forAll(), DAIndex::getGlobalAdjointStateIndex(), and DAJacCon::mesh_.
Referenced by DAJacCon::checkSpecialBCs().
|
protected |
add connectivity phi for pressureInletVelocity
Definition at line 2201 of file DAJacCon.C.
References DAJacCon::daIndex_, DAIndex::getLocalAdjointStateIndex(), DAJacCon::isPIVBCState_, and DAUtility::isValueCloseToRef().
TypeName | ( | "DAJacCon" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
DAJacCon | , | ||
dictionary | , | ||
(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex) | , | ||
(modelType, mesh, daOption, daModel, daIndex) | |||
) |
|
static |
Definition at line 47 of file DAJacCon.C.
References daIndex(), daModel(), daOption(), and mesh.
Referenced by DASolver::calcdFdACT(), DASolver::calcdFdAOA(), DASolver::calcdFdBC(), DASolver::calcdFdFFD(), DASolver::calcdFdW(), DASolver::calcdRdACT(), DASolver::calcdRdAOA(), DASolver::calcdRdBC(), DASolver::calcdRdFFD(), DASolver::calcdRdWT(), ColoringSolid::run(), ColoringCompressible::run(), and ColoringIncompressible::run().
|
pure virtual |
clear members in parent and child objects
Implemented in DAJacCondRdW, DAJacCondFdW, and DAJacConDummy.
|
virtual |
calculate the preallocation vector for initializing the JacCon mat, if necessary
Reimplemented in DAJacCondRdW.
Definition at line 1900 of file DAJacCon.C.
References DAJacCon::modelType_.
|
pure virtual |
initialize the state Jacobian connectivity matrix
Implemented in DAJacCondRdW, DAJacCondFdW, and DAJacConDummy.
|
pure virtual |
assign 1 to all non-zero elements for the Jacobian connecitivyt matrix
Implemented in DAJacCondRdW, DAJacCondFdW, and DAJacConDummy.
|
inline |
get the number of JacCon colors
Definition at line 252 of file DAJacCon.H.
References DAJacCon::nJacConColors_.
Referenced by DAPartDerivdRdW::calcPartDerivMat(), and DAPartDerivdFdW::calcPartDerivMat().
|
virtual |
preallocate dRdW matrix using the preallocVec
Reimplemented in DAJacCondRdW.
Definition at line 1915 of file DAJacCon.C.
References DAJacCon::modelType_.
Referenced by DAPartDerivdRdW::initializePartDerivMat().
void calcJacConColoring | ( | const word | postFix = "" | ) |
compute graph coloring for Jacobian connectivity matrix
Definition at line 1801 of file DAJacCon.C.
References DAJacCon::daColoring_, DAJacCon::daOption_, DAOption::getOption(), DAJacCon::jacCon_, DAJacCon::jacConColors_, DAJacCon::modelType_, DAJacCon::nJacConColors_, DAColoring::parallelD2Coloring(), DAColoring::validateColoring(), and DAUtility::writeVectorBinary().
void readJacConColoring | ( | const word | postFix = "" | ) |
read colors for JacCon
Definition at line 1864 of file DAJacCon.C.
References DAJacCon::daColoring_, DAJacCon::jacCon_, DAJacCon::jacConColors_, DAJacCon::modelType_, DAJacCon::nJacConColors_, DAUtility::readVectorBinary(), and DAColoring::validateColoring().
label coloringExists | ( | const word | postFix = "" | ) | const |
whether the coloring file exists
Definition at line 1770 of file DAJacCon.C.
References DAJacCon::modelType_.
|
inline |
return DAJacCon::jacConColors_
Definition at line 272 of file DAJacCon.H.
References DAJacCon::jacConColors_.
Referenced by DAPartDerivdRdW::calcPartDerivMat(), and DAPartDerivdFdW::calcPartDerivMat().
void calcColoredColumns | ( | const label | colorI, |
Vec | coloredColumn | ||
) | const |
calculate the colored column vector
Definition at line 1950 of file DAJacCon.C.
References DAJacCon::daOption_, DAOption::getOption(), DAUtility::isValueCloseToRef(), DAJacCon::jacCon_, and DAJacCon::jacConColors_.
Referenced by DAPartDerivdRdW::calcPartDerivMat(), and DAPartDerivdFdW::calcPartDerivMat().
|
virtual |
assign values for the objective function vector based on the face and cell value lists
Reimplemented in DAJacCondFdW.
Definition at line 1932 of file DAJacCon.C.
References DAJacCon::modelType_.
Referenced by DAPartDerivdFdW::calcPartDerivMat().
|
protected |
the name of the jacCon matrix
Definition at line 46 of file DAJacCon.H.
Referenced by DAJacCon::calcJacConColoring(), DAJacCon::coloringExists(), DAJacCon::preallocatedRdW(), DAJacCon::readJacConColoring(), DAJacCon::setObjFuncVec(), and DAJacCon::setupJacConPreallocation().
|
protected |
fvMesh
Definition at line 49 of file DAJacCon.H.
Referenced by DAJacCon::addBoundaryFaceConnections(), DAJacCon::addConMatCellFaces(), DAJacCon::addConMatNeighbourCells(), DAJacCon::addStateConnections(), DAJacCon::calcNeiBFaceGlobalCompact(), DAJacCon::checkSpecialBCs(), DAJacCon::combineStateBndCon(), DAJacCon::getLocalCoupledBFaceIndex(), DAJacCon::setPIVVec(), DAJacCondRdW::setupdRdWCon(), DAJacCondFdW::setupJacCon(), and DAJacCon::setupStateBoundaryCon().
|
protected |
DAOption object.
Definition at line 52 of file DAJacCon.H.
Referenced by DAJacCon::calcColoredColumns(), DAJacCon::calcJacConColoring(), DAJacCon::checkSpecialBCs(), DAJacCondRdW::initializeJacCon(), DAJacCon::initializeStateBoundaryCon(), DAJacCondRdW::setupdRdWCon(), and DAJacCondFdW::setupJacCon().
|
protected |
DAModel object.
Definition at line 55 of file DAJacCon.H.
|
protected |
DAIndex object.
Definition at line 58 of file DAJacCon.H.
Referenced by DAJacCon::addBoundaryFaceConnections(), DAJacCon::addConMatCell(), DAJacCon::addConMatCellFaces(), DAJacCon::addConMatNeighbourCells(), DAJacCon::addPhi4PIV(), DAJacCon::addStateConnections(), DAJacCondRdW::allocateJacobianConnections(), DAJacCon::calcNeiBFaceGlobalCompact(), DAJacCon::checkSpecialBCs(), DAJacCon::combineStateBndCon(), DAJacCon::createConnectionMat(), DAJacCondFdW::initializeJacCon(), DAJacCondRdW::initializeJacCon(), DAJacCondFdW::initializePetscVecs(), DAJacCondRdW::initializePetscVecs(), DAJacCondRdW::preallocateJacobianMatrix(), DAJacCon::setPIVVec(), DAJacCondRdW::setupdRdWCon(), DAJacCondFdW::setupJacCon(), DAJacCon::setupStateBoundaryCon(), and DAJacCon::setupStateBoundaryConID().
|
protected |
DAColoring object.
Definition at line 61 of file DAJacCon.H.
Referenced by DAJacCon::calcJacConColoring(), and DAJacCon::readJacConColoring().
|
protected |
DAField object.
Definition at line 64 of file DAJacCon.H.
Referenced by DAJacCon::checkSpecialBCs(), and DAJacCondRdW::setupdRdWCon().
|
protected |
the regState_ list from DAStateInfo object
Definition at line 67 of file DAJacCon.H.
Referenced by DAJacCon::addStateConnections(), DAJacCon::clearDAJacConMembers(), DAJacCon::DAJacCon(), DAJacCondRdW::setupdRdWCon(), DAJacCondFdW::setupJacCon(), and DAJacCon::setupStateBoundaryCon().
|
protected |
matrix to store boundary connectivity levels for state Jacobians
Definition at line 70 of file DAJacCon.H.
Referenced by DAJacCon::addBoundaryFaceConnections(), DAJacCon::clearDAJacConMembers(), DAJacCon::initializeStateBoundaryCon(), DAJacCondRdW::setupdRdWCon(), and DAJacCon::setupStateBoundaryConID().
|
protected |
matrix to store boundary connectivity ID for state Jacobians
Definition at line 73 of file DAJacCon.H.
Referenced by DAJacCon::addBoundaryFaceConnections(), DAJacCon::clearDAJacConMembers(), DAJacCon::initializeStateBoundaryCon(), and DAJacCondRdW::setupdRdWCon().
|
protected |
neibough face global index for a given local boundary face
Definition at line 76 of file DAJacCon.H.
Referenced by DAJacCon::clearDAJacConMembers(), DAJacCon::combineStateBndCon(), DAJacCon::initializeStateBoundaryCon(), and DAJacCon::setupStateBoundaryCon().
|
protected |
Jacobian connectivity mat.
Definition at line 79 of file DAJacCon.H.
Referenced by DAJacCon::calcColoredColumns(), DAJacCon::calcJacConColoring(), DAJacCon::clearDAJacConMembers(), DAJacCondFdW::initializeJacCon(), DAJacCondRdW::initializeJacCon(), DAJacCon::readJacConColoring(), DAJacCondRdW::setupdRdWCon(), and DAJacCondFdW::setupJacCon().
|
protected |
jacCon matrix colors
Definition at line 82 of file DAJacCon.H.
Referenced by DAJacCon::calcColoredColumns(), DAJacCon::calcJacConColoring(), DAJacCon::clearDAJacConMembers(), DAJacCon::getJacConColor(), DAJacCondFdW::initializePetscVecs(), DAJacCondRdW::initializePetscVecs(), and DAJacCon::readJacConColoring().
|
protected |
number of jacCon colors
Definition at line 85 of file DAJacCon.H.
Referenced by DAJacCon::calcJacConColoring(), DAJacCon::getNJacConColors(), and DAJacCon::readJacConColoring().
|
protected |
a vector to show whether a state is connected to a pressureInletVelocity boundary face (3 level max)
Definition at line 179 of file DAJacCon.H.
Referenced by DAJacCon::addPhi4PIV(), and DAJacCon::checkSpecialBCs().