Skip to content

Adjoint API

Michael Andre edited this page Jul 12, 2017 · 24 revisions

Overview

This page describes the API for adjoint-based sensitivities in Kratos.

Adjoint Variables

An adjoint variable is defined for each primal variable by prefixing the variable name with ADJOINT. For example, the adjoint variable of VELOCITY is ADJOINT_VELOCITY.

Adjoint Elements

Adjoint elements are created in the same way as regular elements. The following element functions are used:

GetDofList

The list of adjoint dofs.

CalculateLeftHandSide

The adjoint matrix obtained from the gradient of the residual with respect to the primal variable (e.g., DISPLACEMENT). This is zero if the primal variable is a rate (e.g., VELOCITY).

CalculateFirstDerivativesLHS

The adjoint matrix obtained from the gradient of the residual with respect to first derivatives of the primal variable (e.g., VELOCITY).

CalculateSecondDerivativesLHS

The adjoint matrix obtained from the gradient of the residual with respect to second derivatives of the primal variable (e.,g., ACCELERATION).

Calculate(const Variable<double>& rVariable, double& rOutput, const ProcessInfo& rCurrentProcessInfo)
Calculate(const Variable<array_1d<double, 3>>& rVariable, array_1d<double, 3>& rOutput, const ProcessInfo& rCurrentProcessInfo)

Project information

Getting Started

Tutorials

Developers

Kratos structure

Conventions

Solvers

Debugging, profiling and testing

HOW TOs

Utilities

Kratos API

Kratos Structural Mechanics API

Clone this wiki locally