31 template<
class GeoFieldType>
32 bool Foam::functionObjects::components::calcFieldComponents()
34 typedef typename GeoFieldType::value_type Type;
36 const GeoFieldType& field(lookupObject<GeoFieldType>(
fieldName_));
38 resultNames_.
setSize(Type::nComponents);
40 for (
direction i=0; i<Type::nComponents; i++)
42 resultNames_[i] =
fieldName_ + word(Type::componentNames[i]);
43 store(resultNames_[i], field.component(i));
51 bool Foam::functionObjects::components::calcComponents()
53 if (foundObject<VolField<Type>>(fieldName_))
55 return calcFieldComponents<VolField<Type>>();
57 else if (foundObject<SurfaceField<Type>>(fieldName_))
59 return calcFieldComponents<SurfaceField<Type>>();
void setSize(const label)
Reset size of List.
const word fieldName_
Name of field to process.
ObjectType & store(const tmp< ObjectType > &tfield)
Store the given field in the objectRegistry.