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);
42 for (
direction i=0; i<Type::nComponents; i++)
44 resultNames_[i] =
fieldName_ + word(Type::componentNames[i]);
45 stored = stored &&
store(resultNames_[i], field.component(i));
53 bool Foam::functionObjects::components::calcComponents()
55 if (foundObject<VolField<Type>>(fieldName_))
57 return calcFieldComponents<VolField<Type>>();
59 else if (foundObject<SurfaceField<Type>>(fieldName_))
61 return calcFieldComponents<SurfaceField<Type>>();
void setSize(const label)
Reset size of List.
const word fieldName_
Name of field to process.
bool store(const tmp< ObjectType > &tfield)
Store the given field in the objectRegistry.