Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DAJacCon Class Referenceabstract
Inheritance diagram for DAJacCon:
Inheritance graph
[legend]
Collaboration diagram for DAJacCon:
Collaboration graph
[legend]

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< DAJacConNew (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 DAOptiondaOption_
 DAOption object. More...
 
const DAModeldaModel_
 DAModel object. More...
 
const DAIndexdaIndex_
 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...
 

Detailed Description

Definition at line 34 of file DAJacCon.H.

Constructor & Destructor Documentation

◆ DAJacCon()

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_.

Here is the call graph for this function:

◆ ~DAJacCon()

virtual ~DAJacCon ( )
inlinevirtual

Definition at line 233 of file DAJacCon.H.

Member Function Documentation

◆ initializeStateBoundaryCon()

void initializeStateBoundaryCon ( )
protected

◆ calcNeiBFaceGlobalCompact()

void calcNeiBFaceGlobalCompact ( labelList &  neiBFaceGlobalCompact)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLocalCoupledBFaceIndex()

label getLocalCoupledBFaceIndex ( const label  localFaceI) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setupStateBoundaryCon()

void setupStateBoundaryCon ( Mat *  stateBoundaryCon)
protected

◆ setupStateBoundaryConID()

void setupStateBoundaryConID ( Mat *  stateBoundaryConID)
protected

◆ createConnectionMat()

void createConnectionMat ( Mat *  connectedStates)
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().

Here is the caller graph for this function:

◆ addStateConnections()

void addStateConnections ( Mat  connections,
const label  cellI,
const label  connectedLevelLocal,
const wordList  connectedStatesLocal,
const List< List< word >>  connectedStateInterProc,
const label  addFace 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setConnections()

void setConnections ( Mat  conMat,
const label  idx 
) const
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().

Here is the caller graph for this function:

◆ setupJacobianConnections()

void setupJacobianConnections ( Mat  conMat,
Mat  connections,
const label  idxI 
)
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().

Here is the caller graph for this function:

◆ combineStateBndCon()

void combineStateBndCon ( Mat *  stateBoundaryCon,
Mat *  stateBoundaryConTmp 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addConMatCell()

void addConMatCell ( Mat  conMat,
const label  gRow,
const label  cellI,
const word  stateName,
const PetscScalar  val 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addConMatNeighbourCells()

void addConMatNeighbourCells ( Mat  conMat,
const label  gRow,
const label  cellI,
const word  stateName,
const PetscScalar  val 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addConMatCellFaces()

void addConMatCellFaces ( Mat  conMat,
const label  gRow,
const label  cellI,
const word  stateName,
const PetscScalar  val 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addBoundaryFaceConnections()

void addBoundaryFaceConnections ( Mat  conMat,
const label  gRow,
const label  cellI,
const labelList  v,
const List< List< word >>  connectedStates,
const label  addFaces 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearDAJacConMembers()

void clearDAJacConMembers ( )
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().

Here is the caller graph for this function:

◆ checkSpecialBCs()

void checkSpecialBCs ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPIVVec()

void setPIVVec ( Vec  iSPIV,
const label  idxI 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPhi4PIV()

label addPhi4PIV ( const word  stateName,
const label  idxI,
const label  comp = -1 
)
protected

add connectivity phi for pressureInletVelocity

Definition at line 2201 of file DAJacCon.C.

References DAJacCon::daIndex_, DAIndex::getLocalAdjointStateIndex(), DAJacCon::isPIVBCState_, and DAUtility::isValueCloseToRef().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "DAJacCon"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
DAJacCon  ,
dictionary  ,
(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex ,
(modelType, mesh, daOption, daModel, daIndex  
)

◆ New()

autoPtr< DAJacCon > New ( const word  modelType,
const fvMesh &  mesh,
const DAOption daOption,
const DAModel daModel,
const DAIndex daIndex 
)
static

◆ clear()

virtual void clear ( )
pure virtual

clear members in parent and child objects

Implemented in DAJacCondRdW, DAJacCondFdW, and DAJacConDummy.

◆ setupJacConPreallocation()

void setupJacConPreallocation ( const dictionary &  options)
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_.

◆ initializeJacCon()

virtual void initializeJacCon ( const dictionary &  options)
pure virtual

initialize the state Jacobian connectivity matrix

Implemented in DAJacCondRdW, DAJacCondFdW, and DAJacConDummy.

◆ setupJacCon()

virtual void setupJacCon ( const dictionary &  options)
pure virtual

assign 1 to all non-zero elements for the Jacobian connecitivyt matrix

Implemented in DAJacCondRdW, DAJacCondFdW, and DAJacConDummy.

◆ getNJacConColors()

label getNJacConColors ( ) const
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().

Here is the caller graph for this function:

◆ preallocatedRdW()

void preallocatedRdW ( Mat  dRMat,
const label  transposed 
) const
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().

Here is the caller graph for this function:

◆ calcJacConColoring()

void calcJacConColoring ( const word  postFix = "")

◆ readJacConColoring()

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().

Here is the call graph for this function:

◆ coloringExists()

label coloringExists ( const word  postFix = "") const

whether the coloring file exists

Definition at line 1770 of file DAJacCon.C.

References DAJacCon::modelType_.

◆ getJacConColor()

Vec getJacConColor ( ) const
inline

return DAJacCon::jacConColors_

Definition at line 272 of file DAJacCon.H.

References DAJacCon::jacConColors_.

Referenced by DAPartDerivdRdW::calcPartDerivMat(), and DAPartDerivdFdW::calcPartDerivMat().

Here is the caller graph for this function:

◆ calcColoredColumns()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setObjFuncVec()

void setObjFuncVec ( scalarList  objFuncFaceValues,
scalarList  objFuncCellValues,
Vec  objFuncVec 
) const
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().

Here is the caller graph for this function:

Member Data Documentation

◆ modelType_

const word modelType_
protected

◆ mesh_

const fvMesh& mesh_
protected

◆ daOption_

const DAOption& daOption_
protected

◆ daModel_

const DAModel& daModel_
protected

DAModel object.

Definition at line 55 of file DAJacCon.H.

◆ daIndex_

const DAIndex& daIndex_
protected

◆ daColoring_

DAColoring daColoring_
protected

DAColoring object.

Definition at line 61 of file DAJacCon.H.

Referenced by DAJacCon::calcJacConColoring(), and DAJacCon::readJacConColoring().

◆ daField_

DAField daField_
protected

DAField object.

Definition at line 64 of file DAJacCon.H.

Referenced by DAJacCon::checkSpecialBCs(), and DAJacCondRdW::setupdRdWCon().

◆ stateInfo_

HashTable<wordList> stateInfo_
protected

◆ stateBoundaryCon_

Mat stateBoundaryCon_
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().

◆ stateBoundaryConID_

Mat stateBoundaryConID_
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().

◆ neiBFaceGlobalCompact_

labelList neiBFaceGlobalCompact_
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().

◆ jacCon_

Mat jacCon_
protected

◆ jacConColors_

Vec jacConColors_
protected

◆ nJacConColors_

label nJacConColors_
protected

number of jacCon colors

Definition at line 85 of file DAJacCon.H.

Referenced by DAJacCon::calcJacConColoring(), DAJacCon::getNJacConColors(), and DAJacCon::readJacConColoring().

◆ isPIVBCState_

Vec isPIVBCState_
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().


The documentation for this class was generated from the following files: