Transient adjoint solve object. More...
#include <AdjointTransientSolve.h>
Public Types | |
typedef DataFileName | DataFileParameterType |
Public Member Functions | |
AdjointTransientSolve (Executioner &ex) | |
virtual bool | solve () override |
Overriding parent class so the time-derivative residual is stored for the next time step. More... | |
void | insertForwardSolution (int tstep) |
This function should be called after every converged forward time step. More... | |
void | setForwardSolution (int tstep) |
Takes the previously saved forward solutions residing in the adjoint system and copies them to the available solution states in the forward systems. More... | |
virtual void | initialSetup () |
virtual void | setInnerSolve (SolveObject &solve) |
virtual bool | enabled () const |
std::shared_ptr< MooseObject > | getSharedPtr () |
std::shared_ptr< const MooseObject > | getSharedPtr () const |
MooseApp & | getMooseApp () const |
const std::string & | type () const |
virtual const std::string & | name () const |
std::string | typeAndName () const |
std::string | errorPrefix (const std::string &error_type) const |
void | callMooseError (std::string msg, const bool with_prefix) const |
MooseObjectParameterName | uniqueParameterName (const std::string ¶meter_name) const |
const InputParameters & | parameters () const |
MooseObjectName | uniqueName () const |
const T & | getParam (const std::string &name) const |
std::vector< std::pair< T1, T2 > > | getParam (const std::string ¶m1, const std::string ¶m2) const |
const T * | queryParam (const std::string &name) const |
const T & | getRenamedParam (const std::string &old_name, const std::string &new_name) const |
T | getCheckedPointerParam (const std::string &name, const std::string &error_string="") const |
bool | isParamValid (const std::string &name) const |
bool | isParamSetByUser (const std::string &nm) const |
void | paramError (const std::string ¶m, Args... args) const |
void | paramWarning (const std::string ¶m, Args... args) const |
void | paramInfo (const std::string ¶m, Args... args) const |
void | connectControllableParams (const std::string ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
void | mooseError (Args &&... args) const |
void | mooseErrorNonPrefixed (Args &&... args) const |
void | mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const |
void | mooseWarning (Args &&... args) const |
void | mooseWarningNonPrefixed (Args &&... args) const |
void | mooseDeprecated (Args &&... args) const |
void | mooseInfo (Args &&... args) const |
std::string | getDataFileName (const std::string ¶m) const |
std::string | getDataFileNameByName (const std::string &relative_path) const |
std::string | getDataFilePath (const std::string &relative_path) const |
PerfGraph & | perfGraph () |
bool | isDefaultPostprocessorValue (const std::string ¶m_name, const unsigned int index=0) const |
bool | hasPostprocessor (const std::string ¶m_name, const unsigned int index=0) const |
bool | hasPostprocessorByName (const PostprocessorName &name) const |
std::size_t | coupledPostprocessors (const std::string ¶m_name) const |
const PostprocessorName & | getPostprocessorName (const std::string ¶m_name, const unsigned int index=0) const |
const PostprocessorValue & | getPostprocessorValue (const std::string ¶m_name, const unsigned int index=0) const |
const PostprocessorValue & | getPostprocessorValue (const std::string ¶m_name, const unsigned int index=0) const |
const PostprocessorValue & | getPostprocessorValueOld (const std::string ¶m_name, const unsigned int index=0) const |
const PostprocessorValue & | getPostprocessorValueOld (const std::string ¶m_name, const unsigned int index=0) const |
const PostprocessorValue & | getPostprocessorValueOlder (const std::string ¶m_name, const unsigned int index=0) const |
const PostprocessorValue & | getPostprocessorValueOlder (const std::string ¶m_name, const unsigned int index=0) const |
virtual const PostprocessorValue & | getPostprocessorValueByName (const PostprocessorName &name) const |
virtual const PostprocessorValue & | getPostprocessorValueByName (const PostprocessorName &name) const |
const PostprocessorValue & | getPostprocessorValueOldByName (const PostprocessorName &name) const |
const PostprocessorValue & | getPostprocessorValueOldByName (const PostprocessorName &name) const |
const PostprocessorValue & | getPostprocessorValueOlderByName (const PostprocessorName &name) const |
const PostprocessorValue & | getPostprocessorValueOlderByName (const PostprocessorName &name) const |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
Static Public Member Functions | |
static InputParameters | validParams () |
Public Attributes | |
const ConsoleStream | _console |
Protected Member Functions | |
virtual void | assembleAdjointSystem (SparseMatrix< Number > &matrix, const NumericVector< Number > &solution, NumericVector< Number > &rhs) override |
Overriding parent class so the previous time-derivative residual is added to the right-hand-side of the linear solve. More... | |
void | evaluateTimeResidual (const NumericVector< Number > &solution, NumericVector< Number > &residual) |
This evaluates the time part of the adjoint residual. More... | |
void | checkIntegrity () |
Checks whether the forward and adjoint systems are consistent. More... | |
void | applyNodalBCs (SparseMatrix< Number > &matrix, const NumericVector< Number > &solution, NumericVector< Number > &rhs) |
Helper function for applying nodal BCs to the adjoint matrix and RHS. More... | |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level) const |
PerfID | registerTimedSection (const std::string §ion_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const |
std::string | timedSectionName (const std::string §ion_name) const |
virtual void | addPostprocessorDependencyHelper (const PostprocessorName &) const |
T & | declareRestartableData (const std::string &data_name, Args &&... args) |
ManagedValue< T > | declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
const T & | getRestartableData (const std::string &data_name) const |
T & | declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args) |
T & | declareRecoverableData (const std::string &data_name, Args &&... args) |
T & | declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args) |
T & | declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args) |
std::string | restartableName (const std::string &data_name) const |
Static Protected Member Functions | |
static std::string | getForwardSolutionName (int tstep) |
Prescribed name of the forward solution at a specified time step. More... | |
Private Attributes | |
NumericVector< Number > & | _old_time_residual |
The residual contribution from previous adjoint solutions. More... | |
std::vector< std::string > & | _forward_solutions |
Name of the forward solution at each time step residing in the adjoint system. More... | |
Transient adjoint solve object.
where A* is the transpose of the linearized forward operator at the specified timestep, u* is the adjoint solution, and A_t* is the transpose of the linearized forward time operator.
Definition at line 32 of file AdjointTransientSolve.h.
AdjointTransientSolve::AdjointTransientSolve | ( | Executioner & | ex | ) |
Definition at line 28 of file AdjointTransientSolve.C.
|
protectedinherited |
Helper function for applying nodal BCs to the adjoint matrix and RHS.
Say there is a BC setting the d-th DoF to a dirichlet condition on the forward problem. This basically sets the d-th column of the matrix to zero, the d-th entry of the matrix diagonal to one, and the d-th entry of the RHS to the solution passed in.
matrix | The matrix whose columns are set to 0 |
solution | The solution to replace the entries of the RHS |
rhs | The RHS to to replace with the solution |
Definition at line 159 of file AdjointSolve.C.
Referenced by AdjointSolve::solve().
|
overrideprotectedvirtual |
Overriding parent class so the previous time-derivative residual is added to the right-hand-side of the linear solve.
Reimplemented from AdjointSolve.
Definition at line 96 of file AdjointTransientSolve.C.
|
protectedinherited |
Checks whether the forward and adjoint systems are consistent.
Definition at line 200 of file AdjointSolve.C.
Referenced by AdjointSolve::solve().
|
protected |
This evaluates the time part of the adjoint residual.
This is used to accumulate the source contribution from previous adjoint time steps for the next adjoint time step. It works by evaluating the Jacobian of the time-derivative term on the forward system and multiplying the transpose by the current adjoint solution.
solution | Current adjoint solution |
residual | Vector to save the result into |
Definition at line 107 of file AdjointTransientSolve.C.
Referenced by solve().
|
inlinestaticprotected |
Prescribed name of the forward solution at a specified time step.
tstep | The forward time step |
Definition at line 89 of file AdjointTransientSolve.h.
Referenced by insertForwardSolution().
This function should be called after every converged forward time step.
It adds a new vector (if necessary) to the adjoint system representing the forward solution at the given time step.
tstep | Time step of the forward solution in which to store in _forward_solutions |
Definition at line 49 of file AdjointTransientSolve.C.
Referenced by TransientAndAdjoint::postStep(), and TransientAndAdjoint::preExecute().
Takes the previously saved forward solutions residing in the adjoint system and copies them to the available solution states in the forward systems.
This should be called at each adjoint time step.
tstep | The forward time step index being evaluated during the adjoint solve. |
Definition at line 76 of file AdjointTransientSolve.C.
Referenced by TransientAndAdjoint::postExecute().
|
overridevirtual |
Overriding parent class so the time-derivative residual is stored for the next time step.
Reimplemented from AdjointSolve.
Definition at line 37 of file AdjointTransientSolve.C.
Referenced by TransientAndAdjoint::postExecute().
|
static |
Definition at line 22 of file AdjointTransientSolve.C.
Referenced by TransientAndAdjoint::validParams().
|
protectedinherited |
The number of the nonlinear system representing the adjoint model.
Definition at line 88 of file AdjointSolve.h.
Referenced by AdjointSolve::assembleAdjointSystem().
|
private |
Name of the forward solution at each time step residing in the adjoint system.
Definition at line 98 of file AdjointTransientSolve.h.
Referenced by insertForwardSolution(), and setForwardSolution().
|
protectedinherited |
The number of the nonlinear system representing the forward model.
Definition at line 86 of file AdjointSolve.h.
Referenced by AdjointSolve::applyNodalBCs(), AdjointSolve::assembleAdjointSystem(), and evaluateTimeResidual().
|
protectedinherited |
The nonlinear system representing the adjoint model.
Definition at line 92 of file AdjointSolve.h.
Referenced by AdjointSolve::AdjointSolve(), AdjointSolve::assembleAdjointSystem(), AdjointSolve::checkIntegrity(), evaluateTimeResidual(), insertForwardSolution(), setForwardSolution(), solve(), and AdjointSolve::solve().
|
protectedinherited |
The nonlinear system representing the forward model.
Definition at line 90 of file AdjointSolve.h.
Referenced by AdjointSolve::AdjointSolve(), AdjointSolve::applyNodalBCs(), AdjointSolve::assembleAdjointSystem(), AdjointSolve::checkIntegrity(), evaluateTimeResidual(), insertForwardSolution(), setForwardSolution(), and AdjointSolve::solve().
|
private |
The residual contribution from previous adjoint solutions.
Definition at line 96 of file AdjointTransientSolve.h.
Referenced by assembleAdjointSystem(), and solve().