Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Tag / debug tape recordings #2343

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3801e4d
Throw error message in case the multizone discrete adjoint solver wil…
oleburghardt Aug 14, 2024
0e5f95b
Softcode indentifier/index.
oleburghardt Aug 15, 2024
dc38cc3
Add tag type option to build system.
oleburghardt Aug 15, 2024
19a1a70
Add option to use RealReverseTag as AD type.
oleburghardt Aug 25, 2024
36c922e
Temporarily adjust/hardcode type size for memory alignment in vectori…
oleburghardt Aug 25, 2024
84e97f4
added turbo obj funcs
joshkellyjak Aug 29, 2024
e68f844
Merge branch 'develop' into feature_mz_adjoint_for_turbo
joshkellyjak Aug 29, 2024
bb0831d
thems the breaks
joshkellyjak Aug 29, 2024
4327942
Merge branch 'feature_mz_adjoint_for_turbo' of https://github.com/su2…
joshkellyjak Aug 29, 2024
9f1b07c
Merge remote-tracking branch 'upstream/feature_tag_debug_tape' into f…
joshkellyjak Sep 2, 2024
6e65dd1
Add config option and indicator for a debug discrete adjoint run.
oleburghardt Sep 24, 2024
82f69e9
Add routines for setting tags to AD structure.
oleburghardt Sep 24, 2024
9de8e93
Add kinds of recording for tag tapes.
oleburghardt Sep 24, 2024
57fbcea
Comment out checks in AD structure whether an identifier is active. T…
oleburghardt Sep 24, 2024
3da17d8
Add first WIP version of the tag debug mode to the (multizone) discre…
oleburghardt Sep 24, 2024
b0e7c86
Fix preaccumulation error in ComputeVorticityAndStrainMag (first debu…
oleburghardt Sep 24, 2024
688797a
Merge branch 'develop' into feature_tag_debug_tape
joshkellyjak Sep 24, 2024
8556c2a
Revert small change (will be added to CoDi soon).
oleburghardt Sep 24, 2024
683de77
Resolves tag errors in turbo mode
joshkellyjak Sep 26, 2024
13ca3f5
Revert "Resolves tag errors in turbo mode"
joshkellyjak Sep 26, 2024
1169606
Merge branch 'feature_tag_debug_tape' of https://github.com/su2code/S…
joshkellyjak Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 54 additions & 2 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,11 @@ class CConfig {
TURBOMACHINERY_TYPE *Kind_TurboMachinery;
su2vector<TURBO_INTERFACE_KIND> Kind_TurboInterface;

/* Turbomachinery objective functions */
su2double *EntropyGeneration;
su2double *TotalPressureLoss;
su2double *KineticEnergyLoss;

/* Gradient smoothing options */
su2double SmoothingEps1; /*!< \brief Parameter for the identity part in gradient smoothing. */
su2double SmoothingEps2; /*!< \brief Parameter for the Laplace part in gradient smoothing. */
Expand Down Expand Up @@ -1052,7 +1057,8 @@ class CConfig {
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */
bool DiscreteAdjoint, /*!< \brief AD-based discrete adjoint mode. */
DiscreteAdjointDebug; /*!< \brief Discrete adjoint debug mode using tags. */
su2double Const_DES; /*!< \brief Detached Eddy Simulation Constant. */
WINDOW_FUNCTION Kind_WindowFct; /*!< \brief Type of window (weight) function for objective functional. */
unsigned short Kind_HybridRANSLES; /*!< \brief Kind of Hybrid RANS/LES. */
Expand Down Expand Up @@ -7978,7 +7984,28 @@ class CConfig {
void SetSurface_Species_Variance(unsigned short val_marker, su2double val_surface_species_variance) { Surface_Species_Variance[val_marker] = val_surface_species_variance; }

/*!
* \brief Get the back pressure (static) at an outlet boundary.
* \brief Set entropy generation for a turbomachinery zone
* \param[in] val_iZone - zone index
* \param[in] val_entropy_generation - value of entropy generation
*/
void SetEntropyGeneration(unsigned short val_iZone, su2double val_entropy_generation) { EntropyGeneration[val_iZone] = val_entropy_generation; }

/*!
* \brief Get total pressure loss for a turbomachinery zone
* \param[in] val_iZone - zone index
* \param[in] val_total_pressure_loss - value of total pressure loss
*/
void SetTotalPressureLoss(unsigned short val_iZone, su2double val_total_pressure_loss) { TotalPressureLoss[val_iZone] = val_total_pressure_loss; }

/*!
* \brief Get kinetic energy loss for a turbomachinery zone
* \param[in] val_iZone - zone index
* \param[in] val_kinetic_energy_loss - value of kinetic energy loss
*/
void SetKineticEnergyLoss(unsigned short val_iZone, su2double val_kinetic_energy_loss) { KineticEnergyLoss[val_iZone] = val_kinetic_energy_loss; }

/*!
* \brief Get the back pressure (static) at an outlet boundary.ß
* \param[in] val_index - Index corresponding to the outlet boundary.
* \return The outlet pressure.
*/
Expand Down Expand Up @@ -8257,6 +8284,25 @@ class CConfig {
*/
su2double GetSurface_Species_Variance(unsigned short val_marker) const { return Surface_Species_Variance[val_marker]; }

/*!
* \brief Get entropy generation for a turbomachine at a boundary
* \param[in] val_iZone - zone index
*/
su2double GetEntropyGeneration(unsigned short val_iZone) const { return EntropyGeneration[val_iZone]; }

/*!
* \brief Get total pressure loss for a turbomachinery zone
* \param[in] val_iZone - zone index
*/
su2double GetTotalPressureLoss(unsigned short val_iZone) const { return TotalPressureLoss[val_iZone]; }

/*!
* \brief Get kinetic energy loss for a turbomachinery zone
* \param[in] val_iZone - zone index
*/
su2double GetKineticEnergyLoss(unsigned short val_iZone) const { return KineticEnergyLoss[val_iZone]; }


/*!
* \brief Get the back pressure (static) at an outlet boundary.
* \param[in] val_index - Index corresponding to the outlet boundary.
Expand Down Expand Up @@ -8904,6 +8950,12 @@ class CConfig {
*/
bool GetDiscrete_Adjoint(void) const { return DiscreteAdjoint; }

/*!
* \brief Get the indicator whether a debug run for the discrete adjoint solver will be started.
* \return the discrete adjoint debug indicator.
*/
bool GetDiscrete_Adjoint_Debug(void) const { return DiscreteAdjointDebug; }

/*!
* \brief Get the number of subiterations while a ramp is applied.
* \return Number of FSI subiters.
Expand Down
56 changes: 39 additions & 17 deletions Common/include/basic_types/ad_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/
namespace AD {
#ifndef CODI_REVERSE_TYPE

using Identifier = int;

/*!
* \brief Start the recording of the operations and involved variables.
* If called, the computational graph of all operations occuring after the call will be stored,
Expand Down Expand Up @@ -101,14 +104,20 @@ inline void EndUseAdjoints() {}
* \param[in] index - Position in the adjoint vector.
* \param[in] val - adjoint value to be set.
*/
inline void SetDerivative(int index, const double val) {}
inline void SetDerivative(Identifier index, const double val) {}

/*!
* \brief Extracts the adjoint value at index
* \param[in] index - position in the adjoint vector where the derivative will be extracted.
* \return Derivative value.
*/
inline double GetDerivative(int index) { return 0.0; }
inline double GetDerivative(Identifier index) { return 0.0; }

/*!
* \brief Returns the identifier that represents an inactive variable.
* \return Passive index.
*/
inline Identifier GetPassiveIndex() { return 0; }

/*!
* \brief Clears the currently stored adjoints but keeps the computational graph.
Expand Down Expand Up @@ -259,7 +268,13 @@ inline void SetExtFuncOut(T&& data, const int size_x, const int size_y) {}
* \param[in] data - variable whose gradient information will be extracted.
* \param[in] index - where obtained gradient information will be stored.
*/
inline void SetIndex(int& index, const su2double& data) {}
inline void SetIndex(Identifier& index, const su2double& data) {}

/*!
* \brief Sets the tag tape to a specific tag.
* \param[in] tag - the number to which the tag is set.
*/
inline void SetTag(int tag) {}

/*!
* \brief Pushes back the current tape position to the tape position's vector.
Expand Down Expand Up @@ -304,6 +319,7 @@ inline void EndNoSharedReading() {}
using CheckpointHandler = codi::ExternalFunctionUserData;

using Tape = su2double::Tape;
using Identifier = su2double::Identifier;

#ifdef HAVE_OPDI
using ExtFuncHelper = codi::OpenMPExternalFunctionHelper<su2double>;
Expand Down Expand Up @@ -470,14 +486,16 @@ FORCEINLINE void BeginUseAdjoints() { AD::getTape().beginUseAdjointVector(); }

FORCEINLINE void EndUseAdjoints() { AD::getTape().endUseAdjointVector(); }

FORCEINLINE void SetIndex(int& index, const su2double& data) { index = data.getIdentifier(); }
FORCEINLINE void SetIndex(Identifier& index, const su2double& data) { index = data.getIdentifier(); }

FORCEINLINE void SetTag(int tag) { AD::getTape().setCurTag(tag); }

// WARNING: For performance reasons, this method does not perform bounds checking.
// When using it, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints().
// This method does not perform locking either.
// It should be safeguarded by calls to AD::BeginUseAdjoints() and AD::EndUseAdjoints().
FORCEINLINE void SetDerivative(int index, const double val) {
if (index == 0) // Allow multiple threads to "set the derivative" of passive variables without causing data races.
FORCEINLINE void SetDerivative(Identifier index, const double val) {
if (!AD::getTape().isIdentifierActive(index)) // Allow multiple threads to "set the derivative" of passive variables without causing data races.
return;

AD::getTape().setGradient(index, val, codi::AdjointsManagement::Manual);
Expand All @@ -488,10 +506,12 @@ FORCEINLINE void SetDerivative(int index, const double val) {
// Otherwise, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints().
// This method does not perform locking either.
// It should be safeguarded by calls to AD::BeginUseAdjoints() and AD::EndUseAdjoints().
FORCEINLINE double GetDerivative(int index) {
FORCEINLINE double GetDerivative(Identifier index) {
return AD::getTape().getGradient(index, codi::AdjointsManagement::Manual);
}

FORCEINLINE Identifier GetPassiveIndex() { return AD::getTape().getPassiveIndex(); }

FORCEINLINE bool IsIdentifierActive(su2double const& value) {
return getTape().isIdentifierActive(value.getIdentifier());
}
Expand All @@ -502,7 +522,8 @@ FORCEINLINE void SetPreaccIn() {}
template <class T, class... Ts, su2enable_if<std::is_same<T, su2double>::value> = 0>
FORCEINLINE void SetPreaccIn(const T& data, Ts&&... moreData) {
if (!PreaccActive) return;
if (IsIdentifierActive(data)) PreaccHelper.addInput(data);
// if (IsIdentifierActive(data))
PreaccHelper.addInput(data);
SetPreaccIn(moreData...);
}

Expand All @@ -515,9 +536,9 @@ template <class T>
FORCEINLINE void SetPreaccIn(const T& data, const int size) {
if (PreaccActive) {
for (int i = 0; i < size; i++) {
if (IsIdentifierActive(data[i])) {
// if (IsIdentifierActive(data[i])) {

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
PreaccHelper.addInput(data[i]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
}
}
}
Expand All @@ -527,9 +548,9 @@ FORCEINLINE void SetPreaccIn(const T& data, const int size_x, const int size_y)
if (!PreaccActive) return;
for (int i = 0; i < size_x; i++) {
for (int j = 0; j < size_y; j++) {
if (IsIdentifierActive(data[i][j])) {
// if (IsIdentifierActive(data[i][j])) {

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
PreaccHelper.addInput(data[i][j]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
}
}
}
Expand All @@ -547,17 +568,18 @@ FORCEINLINE void SetPreaccOut() {}
template <class T, class... Ts, su2enable_if<std::is_same<T, su2double>::value> = 0>
FORCEINLINE void SetPreaccOut(T& data, Ts&&... moreData) {
if (!PreaccActive) return;
if (IsIdentifierActive(data)) PreaccHelper.addOutput(data);
// if (IsIdentifierActive(data))
PreaccHelper.addOutput(data);
SetPreaccOut(moreData...);
}

template <class T>
FORCEINLINE void SetPreaccOut(T&& data, const int size) {
if (PreaccActive) {
for (int i = 0; i < size; i++) {
if (IsIdentifierActive(data[i])) {
// if (IsIdentifierActive(data[i])) {

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
PreaccHelper.addOutput(data[i]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
}
}
}
Expand All @@ -567,9 +589,9 @@ FORCEINLINE void SetPreaccOut(T&& data, const int size_x, const int size_y) {
if (!PreaccActive) return;
for (int i = 0; i < size_x; i++) {
for (int j = 0; j < size_y; j++) {
if (IsIdentifierActive(data[i][j])) {
// if (IsIdentifierActive(data[i][j])) {

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
PreaccHelper.addOutput(data[i][j]);
}
// }

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Common/include/code_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ using su2double = codi::RealReversePrimal;
using su2double = codi::RealReversePrimalIndexGen<double, double, codi::ReuseIndexManager<int> >;
#elif defined(CODI_PRIMAL_MULTIUSE_TAPE)
using su2double = codi::RealReversePrimalIndex;
#elif defined(CODI_TAG_TAPE)
using su2double = codi::RealReverseTag;
#else
#error "Please define a CoDiPack tape."
#endif
Expand Down
5 changes: 2 additions & 3 deletions Common/include/geometry/dual_grid/CPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ class CPoint {
su2activevector MaxLength; /*!< \brief The maximum cell-center to cell-center length. */
su2activevector RoughnessHeight; /*!< \brief Roughness of the nearest wall. */

su2matrix<int> AD_InputIndex; /*!< \brief Indices of Coord variables in the adjoint vector. */
su2matrix<int>
AD_OutputIndex; /*!< \brief Indices of Coord variables in the adjoint vector after having been updated. */
su2matrix<AD::Identifier> AD_InputIndex; /*!< \brief Indices of Coord variables in the adjoint vector. */
su2matrix<AD::Identifier> AD_OutputIndex; /*!< \brief Indices of Coord variables in the adjoint vector after having been updated. */

/*!
* \brief Allocate fields required by the minimal constructor.
Expand Down
8 changes: 8 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,9 @@ enum ENUM_OBJECTIVE {
TOPOL_DISCRETENESS = 63, /*!< \brief Measure of the discreteness of the current topology. */
TOPOL_COMPLIANCE = 64, /*!< \brief Measure of the discreteness of the current topology. */
STRESS_PENALTY = 65, /*!< \brief Penalty function of VM stresses above a maximum value. */
ENTROPY_GENERATION = 80, /*!< \brief Entropy generation turbomachinery objective function. */
TOTAL_PRESSURE_LOSS = 81, /*!< \brief Total pressure loss turbomachinery objective function. */
KINETIC_ENERGY_LOSS = 82 /*!< \breif Kinetic energy loss coefficient turbomachinery objective function. */
};
static const MapType<std::string, ENUM_OBJECTIVE> Objective_Map = {
MakePair("DRAG", DRAG_COEFFICIENT)
Expand Down Expand Up @@ -2052,6 +2055,9 @@ static const MapType<std::string, ENUM_OBJECTIVE> Objective_Map = {
MakePair("TOPOL_DISCRETENESS", TOPOL_DISCRETENESS)
MakePair("TOPOL_COMPLIANCE", TOPOL_COMPLIANCE)
MakePair("STRESS_PENALTY", STRESS_PENALTY)
MakePair("ENTROPY_GENERATION", ENTROPY_GENERATION)
MakePair("TOTAL_PRESSURE_LOSS", TOTAL_PRESSURE_LOSS)
MakePair("KINETIC_ENERGY_LOSS", KINETIC_ENERGY_LOSS)
};

/*!
Expand Down Expand Up @@ -2493,6 +2499,8 @@ enum class RECORDING {
MESH_COORDS,
MESH_DEFORM,
SOLUTION_AND_MESH,
TAG_INIT_SOLUTION_VARIABLES,
TAG_CHECK_SOLUTION_VARIABLES
};

/*!
Expand Down
4 changes: 2 additions & 2 deletions Common/include/parallelization/vectorization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class Array : public CVecExpr<Array<Scalar_t, N>, Scalar_t> {
public:
using Scalar = Scalar_t;
enum : size_t { Size = N };
enum : size_t { Align = Size * sizeof(Scalar) };
enum : size_t { Align = Size * 32 };
static constexpr bool StoreAsRef = true;

private:
alignas(Size * sizeof(Scalar)) Scalar x_[N];
alignas(Size * 32) Scalar x_[N];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be okay with replacing 32 by a function to find the next power of 2? (Requirement of alignas.) Or could this be done any better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what type is the result not a power of 2?
If we use a fixed number instead of sizeof, arrays of this type may take more space than necessary.

Copy link
Contributor Author

@oleburghardt oleburghardt Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reverse tag type is 24 I think. If sizeof(Scalar) is already a power of 2 that function should of course not change it :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so the tag doesn't have a float/double part? Then it should be ok to round Size * sizeof(Scalar) to the next power of 2.
Or maybe using Size * alignof(Scalar), that may be more generic and achieve the desired result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it does contain at least a double for the primal value (show must go on). I'll check or ask what the remaining bytes are for besides two ints for index and tag. But sizeof(RealReverseTag) = 24.


public:
#define ARRAY_BOILERPLATE \
Expand Down
34 changes: 32 additions & 2 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,11 @@ void CConfig::SetPointersNull() {
nBlades = nullptr;
FreeStreamTurboNormal = nullptr;

/*--- Turbomachinery Objective Functions ---*/
EntropyGeneration = nullptr;
TotalPressureLoss = nullptr;
KineticEnergyLoss = nullptr;

top_optim_kernels = nullptr;
top_optim_kernel_params = nullptr;
top_optim_filter_radius = nullptr;
Expand Down Expand Up @@ -1105,11 +1110,19 @@ void CConfig::SetConfig_Options() {
addBoolOption("MULTIZONE", Multizone_Problem, NO);
/*!\brief PHYSICAL_PROBLEM \n DESCRIPTION: Physical governing equations \n Options: see \link Solver_Map \endlink \n DEFAULT: NONE \ingroup Config*/
addEnumOption("MULTIZONE_SOLVER", Kind_MZSolver, Multizone_Map, ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL);
#ifdef CODI_REVERSE_TYPE
#if defined (CODI_REVERSE_TYPE)
const bool discAdjDefault = true;
# if defined (CODI_TAG_TAPE)
const bool discAdjDebugDefault = true;
# else
const bool discAdjDebugDefault = false;
# endif
#else
const bool discAdjDefault = false;
const bool discAdjDebugDefault = false;
#endif
// TODO Set the indicator through MATH_PROBLEM
DiscreteAdjointDebug = discAdjDebugDefault;
/*!\brief MATH_PROBLEM \n DESCRIPTION: Mathematical problem \n Options: DIRECT, ADJOINT \ingroup Config*/
addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, discAdjDefault, Restart_Flow, discAdjDefault);
/*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/
Expand Down Expand Up @@ -3396,8 +3409,17 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i

/*--- Using default frequency of 250 for all files when steady, and 1 for unsteady. ---*/
for (auto iVolumeFreq = 0; iVolumeFreq < nVolumeOutputFrequencies; iVolumeFreq++){
VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250;
if (Multizone_Problem && DiscreteAdjoint) {
VolumeOutputFrequencies[iVolumeFreq] = nOuterIter;
}
else {
VolumeOutputFrequencies[iVolumeFreq] = Time_Domain ? 1 : 250;
}
}
} else if (Multizone_Problem && DiscreteAdjoint) {
SU2_MPI::Error(string("OUTPUT_WRT_FREQ cannot be specified for this solver "
"(writing of restart and sensitivity files not possible for multizone discrete adjoint during runtime yet).\n"
"Please remove this option from the config file, output files will be written when solver finalizes.\n"), CURRENT_FUNCTION);
} else if (nVolumeOutputFrequencies < nVolumeOutputFiles) {
/*--- If there are fewer frequencies than files, repeat the last frequency.
* This is useful to define 1 frequency for the restart file and 1 frequency for all the visualization files. ---*/
Expand Down Expand Up @@ -6017,6 +6039,11 @@ void CConfig::SetMarkers(SU2_COMPONENT val_software) {
Marker_CfgFile_ZoneInterface[iMarker_CfgFile] = YES;
}

/*--- Allocate memory for turbomachinery objective functions ---*/
EntropyGeneration = new su2double[nZone] ();
TotalPressureLoss = new su2double[nZone] ();
KineticEnergyLoss = new su2double[nZone] ();

/*--- Identification of Turbomachinery markers and flag them---*/

for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) {
Expand Down Expand Up @@ -8503,6 +8530,9 @@ string CConfig::GetObjFunc_Extension(string val_filename) const {
case TOPOL_DISCRETENESS: AdjExt = "_topdisc"; break;
case TOPOL_COMPLIANCE: AdjExt = "_topcomp"; break;
case STRESS_PENALTY: AdjExt = "_stress"; break;
case ENTROPY_GENERATION: AdjExt = "_entg"; break;
case TOTAL_PRESSURE_LOSS: AdjExt = "_tot_press_loss"; break;
case KINETIC_ENERGY_LOSS: AdjExt = "_kin_en_loss"; break;
}
}
else{
Expand Down
4 changes: 2 additions & 2 deletions Common/src/geometry/dual_grid/CPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig* config) {
}

if (config->GetDiscrete_Adjoint()) {
AD_InputIndex.resize(npoint, nDim) = 0;
AD_OutputIndex.resize(npoint, nDim) = 0;
AD_InputIndex.resize(npoint, nDim) = AD::GetPassiveIndex();
AD_OutputIndex.resize(npoint, nDim) = AD::GetPassiveIndex();
}

/*--- Multigrid structures. ---*/
Expand Down
Loading
Loading