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 getSnapshotField<VolFieldType>();
43 else if (foundObject<SurfaceFieldType>(fieldName_))
45 return getSnapshotField<SurfaceFieldType>();
52 template<
class GeoFieldType>
53 bool Foam::functionObjects::DMD::getSnapshotField()
67 std::rotate(z_.begin(), z_.begin() + nSnap_, z_.end());
72 pTraits<typename GeoFieldType::value_type>::nComponents;
74 const GeoFieldType&
field = lookupObject<GeoFieldType>(fieldName_);
78 const label nField =
field.size();
80 for (
direction dir = 0; dir < nComps; ++dir)
82 z_.subColumn(0, nSnap_ + dir*nField, nField) =
field.component(dir);
87 const label patchi = mesh_.boundaryMesh().findPatchID(patch_);
92 <<
"Cannot find patch " << patch_
96 const typename GeoFieldType::Boundary& bf =
field.boundaryField();
98 const Field<typename GeoFieldType::value_type>& pbf = bf[patchi];
100 const label nField = pbf.size();
102 for (
direction dir = 0; dir < nComps; ++dir)
104 z_.subColumn(0, nSnap_ + dir*nField, nField) = pbf.component(dir);