Skip to content

Commit

Permalink
Disabled dFdW coloring for AD mode. (mdolab#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
friedenhe authored Sep 6, 2024
1 parent 2a147a6 commit a57881f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ void ColoringCompressible::run()
}

// dFdW
// skip dFdW coloring for AD mode.
word adMode = daOption.getSubDictOption<word>("useAD", "mode");
if (adMode == "forward" || adMode == "reverse")
{
return;
}
const dictionary& allOptions = daOption.getAllOptions();
dictionary objFuncDict = allOptions.subDict("objFunc");
// create a dummy DAResidual just for initializing DAObjFunc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ void ColoringIncompressible::run()
}

// dFdW
// skip dFdW coloring for AD mode.
word adMode = daOption.getSubDictOption<word>("useAD", "mode");
if (adMode == "forward" || adMode == "reverse")
{
return;
}
const dictionary& allOptions = daOption.getAllOptions();
dictionary objFuncDict = allOptions.subDict("objFunc");
// create a dummy DAResidual just for initializing DAObjFunc
Expand Down
6 changes: 6 additions & 0 deletions src/utilities/coloring/pyColoringSolid/ColoringSolid.C
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ void ColoringSolid::run()
}

// dFdW
// skip dFdW coloring for AD mode.
word adMode = daOption.getSubDictOption<word>("useAD", "mode");
if (adMode == "forward" || adMode == "reverse")
{
return;
}
const dictionary& allOptions = daOption.getAllOptions();
dictionary objFuncDict = allOptions.subDict("objFunc");
// create a dummy DAResidual just for initializing DAObjFunc
Expand Down

0 comments on commit a57881f

Please sign in to comment.