Skip to content
Snippets Groups Projects
Commit 3cd2b2c6 authored by Vaggelis Papoutsis's avatar Vaggelis Papoutsis Committed by Andrew Heather
Browse files

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)
parent c3b212e0
Branches
Tags
1 merge request!649ENH: update of the adjoint library and introduction of topology optimisation
......@@ -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;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment