mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: The (final) sensitivities involved in topology optimisation
runs can now be written to files using the 'writeAllFields' flag in the designVariables dictionary (defaults to false)
This commit is contained in:
committed by
Andrew Heather
parent
c3b212e06c
commit
3cd2b2c692
@ -488,6 +488,26 @@ Foam::tmp<Foam::scalarField> Foam::topODesignVariables::assembleSensitivities
|
||||
// Add part due to regularisation and projection
|
||||
regularisation_.postProcessSens(objectiveSens);
|
||||
|
||||
// Write final sensitivities field
|
||||
if (writeAllFields_ && mesh_.time().writeTime())
|
||||
{
|
||||
volScalarField sens
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"topOSens" + adjointSens.getAdjointSolver().solverName(),
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar(dimless, Zero)
|
||||
);
|
||||
sens.primitiveFieldRef() = objectiveSens;
|
||||
sens.write();
|
||||
}
|
||||
|
||||
return tobjectiveSens;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user