33 template<
class GeoFieldType>
34 bool Foam::functionObjects::STDMD::getSnapshot()
47 const GeoFieldType& Field = lookupObject<GeoFieldType>(fieldName_);
48 const label nField = Field.size();
50 for (
direction dir = 0; dir < nComps_; ++dir)
52 z_.
subColumn(0, nSnap_ + dir*nField, nField) = Field.component(dir);
60 bool Foam::functionObjects::STDMD::getSnapshotType()
62 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
63 typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
65 if (foundObject<VolFieldType>(fieldName_))
67 return getSnapshot<VolFieldType>();
69 else if (foundObject<SurfaceFieldType>(fieldName_))
71 return getSnapshot<SurfaceFieldType>();
79 bool Foam::functionObjects::STDMD::getComps()
81 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
82 typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
84 if (foundObject<VolFieldType>(fieldName_))
86 nComps_ = pTraits<typename VolFieldType::value_type>::nComponents;
89 else if (foundObject<SurfaceFieldType>(fieldName_))
91 nComps_ = pTraits<typename SurfaceFieldType::value_type>::nComponents;
100 void Foam::functionObjects::STDMD::filterIndexed
103 const UList<label>& indices
107 List<Type> lstWithin(indices.size());
111 for (
const auto& i : indices)
113 lstWithin[j] = lst[i];
116 lst.transfer(lstWithin);
120 template<
class MatrixType>
121 void Foam::functionObjects::STDMD::filterIndexed
124 const UList<label>& indices
128 MatrixType matWithin(
labelPair(mat.m(), indices.size()));
132 for (
const auto& i : indices)
134 matWithin.subColumn(j) = mat.subColumn(i);
137 mat.transfer(matWithin);