34 bool Foam::functionObjects::DMD::getSnapshot()
36 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
37 typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
39 if (foundObject<VolFieldType>(fieldName_))
41 return storeSnapshot<VolFieldType>();
43 else if (foundObject<SurfaceFieldType>(fieldName_))
45 return storeSnapshot<SurfaceFieldType>();
52 template<
class GeoFieldType>
53 bool Foam::functionObjects::DMD::storeSnapshot()
67 std::rotate(z_.begin(), z_.begin() + nSnap_, z_.end());
74 const GeoFieldType&
field = lookupObject<GeoFieldType>(fieldName_);
79 const label nField =
field.size();
81 for (
direction dir = 0; dir < nComps; ++dir)
83 z_.subColumn(0, rowi, nField) =
field.component(dir);
91 mesh_.boundaryMesh().patchSet(patches_).sortedToc()
94 for (
const label patchi : patchis)
96 const typename GeoFieldType::Boundary& bf =
field.boundaryField();
98 const Field<typename GeoFieldType::value_type>& pbf = bf[patchi];
100 const label nField = pbf.size();
104 for (
direction dir = 0; dir < nComps; ++dir)
106 z_.subColumn(0, rowi, nField) = pbf.component(dir);
118 bool Foam::functionObjects::DMD::nComponents
120 const word& fieldName,
124 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
125 typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
127 if (mesh_.foundObject<VolFieldType>(fieldName))
132 else if (mesh_.foundObject<SurfaceFieldType>(fieldName))
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
List< label > labelList
A List of labels.