mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Function object updates
This commit is contained in:
@ -335,7 +335,6 @@ void Foam::fieldAverage::write()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
calcAverages();
|
||||
writeAverages();
|
||||
writeAveragingProperties();
|
||||
|
||||
|
||||
@ -96,7 +96,20 @@ void Foam::fieldCoordinateSystemTransform::read(const dictionary& dict)
|
||||
|
||||
void Foam::fieldCoordinateSystemTransform::execute()
|
||||
{
|
||||
// Do nothing
|
||||
if (active_)
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
forAll(fieldSet_, fieldI)
|
||||
{
|
||||
// If necessary load field
|
||||
transform<scalar>(fieldSet_[fieldI]);
|
||||
transform<vector>(fieldSet_[fieldI]);
|
||||
transform<sphericalTensor>(fieldSet_[fieldI]);
|
||||
transform<symmTensor>(fieldSet_[fieldI]);
|
||||
transform<tensor>(fieldSet_[fieldI]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -114,16 +127,23 @@ void Foam::fieldCoordinateSystemTransform::timeSet()
|
||||
|
||||
void Foam::fieldCoordinateSystemTransform::write()
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
forAll(fieldSet_, fieldI)
|
||||
if (active_)
|
||||
{
|
||||
// If necessary load field
|
||||
transform<scalar>(fieldSet_[fieldI]);
|
||||
transform<vector>(fieldSet_[fieldI]);
|
||||
transform<sphericalTensor>(fieldSet_[fieldI]);
|
||||
transform<symmTensor>(fieldSet_[fieldI]);
|
||||
transform<tensor>(fieldSet_[fieldI]);
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
forAll(fieldSet_, fieldI)
|
||||
{
|
||||
const word fieldName = fieldSet_[fieldI] + ":Transformed";
|
||||
|
||||
const regIOobject& field =
|
||||
obr_.lookupObject<regIOobject>(fieldName);
|
||||
|
||||
Info<< " writing field " << field.name() << nl;
|
||||
|
||||
field.write();
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ void Foam::fieldCoordinateSystemTransform::transformField
|
||||
const Type& field
|
||||
) const
|
||||
{
|
||||
const word& fieldName = field.name() + "Transformed";
|
||||
const word& fieldName = field.name() + ":Transformed";
|
||||
|
||||
if (!obr_.foundObject<Type>(fieldName))
|
||||
{
|
||||
|
||||
@ -328,32 +328,8 @@ void Foam::nearWallFields::execute()
|
||||
{
|
||||
Info<< "nearWallFields:execute()" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::nearWallFields::end()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "nearWallFields:end()" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::nearWallFields::timeSet()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::nearWallFields::write()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "nearWallFields:write()" << endl;
|
||||
}
|
||||
|
||||
// Do nothing
|
||||
if (active_)
|
||||
{
|
||||
if
|
||||
@ -380,7 +356,7 @@ void Foam::nearWallFields::write()
|
||||
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
Info<< " Writing sampled fields to " << obr_.time().timeName()
|
||||
Info<< " Sampling fields fields to " << obr_.time().timeName()
|
||||
<< endl;
|
||||
|
||||
sampleFields(vsf_);
|
||||
@ -388,8 +364,37 @@ void Foam::nearWallFields::write()
|
||||
sampleFields(vSpheretf_);
|
||||
sampleFields(vSymmtf_);
|
||||
sampleFields(vtf_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::nearWallFields::end()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "nearWallFields:end()" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::nearWallFields::timeSet()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
void Foam::nearWallFields::write()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "nearWallFields:write()" << endl;
|
||||
}
|
||||
|
||||
if (active_)
|
||||
{
|
||||
Info<< " Writing sampled fields to " << obr_.time().timeName()
|
||||
<< endl;
|
||||
|
||||
// Write fields
|
||||
forAll(vsf_, i)
|
||||
{
|
||||
vsf_[i].write();
|
||||
|
||||
@ -53,6 +53,27 @@ Foam::processorField::processorField
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volScalarField* procFieldPtr
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"processorID",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
mesh.objectRegistry::store(procFieldPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -88,7 +109,14 @@ void Foam::processorField::read(const dictionary& dict)
|
||||
|
||||
void Foam::processorField::execute()
|
||||
{
|
||||
// Do nothing
|
||||
if (active_)
|
||||
{
|
||||
const volScalarField& procField =
|
||||
obr_.lookupObject<volScalarField>("processorID");
|
||||
|
||||
const_cast<volScalarField&>(procField) ==
|
||||
dimensionedScalar("procI", dimless, Pstream::myProcNo());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,20 +136,8 @@ void Foam::processorField::write()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
volScalarField procField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"processorID",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("procI", dimless, Pstream::myProcNo())
|
||||
);
|
||||
const volScalarField& procField =
|
||||
obr_.lookupObject<volScalarField>("processorID");
|
||||
|
||||
procField.write();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user