Go to the documentation of this file.
22 DAResidual::DAResidual(
31 mesh.time().timeName(),
41 daField_(
mesh, daOption, daModel, daIndex)
56 if (daOption.
getAllOptions().lookupOrDefault<label>(
"debug", 0))
58 Info <<
"Selecting " << modelType <<
" for DAResidual" << endl;
61 dictionaryConstructorTable::iterator cstrIter =
62 dictionaryConstructorTablePtr_->find(modelType);
65 if (cstrIter == dictionaryConstructorTablePtr_->end())
76 <<
"Unknown DAResidual type "
77 << modelType << nl << nl
78 <<
"Valid DAResidual types:" << endl
79 << dictionaryConstructorTablePtr_->sortedToc()
84 return autoPtr<DAResidual>(
85 cstrIter()(modelType,
mesh, daOption, daModel, daIndex));
91 const dictionary& options,
129 VecZeroEntries(resVec);
133 label updateState = options.getLabel(
"updateState");
135 label updateMesh = options.getLabel(
"updateMesh");
137 label setResVec = options.getLabel(
"setResVec");
141 FatalErrorIn(
"DAResidual::masterFunction")
142 <<
"updateMesh=true not supported!"
143 << abort(FatalError);
171 FatalErrorIn(
"DAResidual::calcPCMatWithFvMatrix")
172 <<
"Child class not implemented!"
173 << abort(FatalError);
virtual void correctBoundaryConditions()=0
update the boundary condition for all the states in the selected solver
void calcResiduals(const dictionary &options)
calculate the residuals for model state variables
virtual void calcPCMatWithFvMatrix(Mat PCMat)
calculating the adjoint preconditioner matrix using fvMatrix
virtual void updateIntermediateVariables()=0
update any intermdiate variables that are dependent on state variables and are used in calcResiduals
DAField daField_
DAField object.
const dictionary & getAllOptions() const
return a reference of allOptions_ dictionary
defineRunTimeSelectionTable(DAFunction, dictionary)
static autoPtr< DAResidual > New(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
defineTypeNameAndDebug(DAFunction, 0)
void correctBoundaryConditions()
correct boundary conditions for model states
void stateVec2OFField(const Vec stateVec) const
assign the fields in OpenFOAM based on the state vector
const DAModel & daModel_
DAModel object.
void masterFunction(const dictionary &options, const Vec xvVec, const Vec wVec, Vec resVec)
the master function that compute the residual vector given the state and point vectors
void ofResField2ResVec(Vec resVec) const
assign the residual vector based on the residual field in OpenFOAM
void specialBCTreatment()
apply special treatment for boundary conditions
virtual void calcResiduals(const dictionary &options)=0
compute residuals
void updateIntermediateVariables()
update intermediate variables that are dependent on the model states