mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: function obejct updates
This commit is contained in:
@ -51,7 +51,15 @@ Foam::fieldCoordinateSystemTransform::fieldCoordinateSystemTransform
|
||||
coordSys_(obr, dict)
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
|
||||
Info<< type() << " " << name_ << ":" << nl
|
||||
<< " Applying transformation from global Cartesian to local "
|
||||
<< coordSys_ << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -63,15 +71,9 @@ Foam::fieldCoordinateSystemTransform::fieldCoordinateSystemTransform
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
|
||||
Info<< type() << ":" << nl
|
||||
<< " Applying transformation from global Cartesian to local "
|
||||
<< coordSys_ << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -112,6 +114,8 @@ void Foam::fieldCoordinateSystemTransform::timeSet()
|
||||
|
||||
void Foam::fieldCoordinateSystemTransform::write()
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
forAll(fieldSet_, fieldI)
|
||||
{
|
||||
// If necessary load field
|
||||
|
||||
@ -39,25 +39,9 @@ void Foam::fieldCoordinateSystemTransform::transformField
|
||||
{
|
||||
const word& fieldName = field.name() + "Transformed";
|
||||
|
||||
dimensionedTensor R("R", field.dimensions(), coordSys_.R().R());
|
||||
|
||||
if (obr_.foundObject<Type>(fieldName))
|
||||
if (!obr_.foundObject<Type>(fieldName))
|
||||
{
|
||||
Type& transField =
|
||||
const_cast<Type&>(obr_.lookupObject<Type>(fieldName));
|
||||
|
||||
transField == field;
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
transField.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Type& transField = obr_.store
|
||||
obr_.store
|
||||
(
|
||||
new Type
|
||||
(
|
||||
@ -72,14 +56,23 @@ void Foam::fieldCoordinateSystemTransform::transformField
|
||||
field
|
||||
)
|
||||
);
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
transField.write();
|
||||
}
|
||||
|
||||
Type& transField =
|
||||
const_cast<Type&>(obr_.lookupObject<Type>(fieldName));
|
||||
|
||||
transField == field;
|
||||
|
||||
dimensionedTensor R("R", field.dimensions(), coordSys_.R().R());
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
Info<< " writing field " << transField.name() << nl << endl;
|
||||
|
||||
transField.write();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user