mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Field: Add block member function to return sub-sets of the field as VectorSpaces
This commit is contained in:
@ -611,6 +611,19 @@ void Foam::Field<Type>::replace
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
template<class VSForm>
|
||||
VSForm Foam::Field<Type>::block(const label start) const
|
||||
{
|
||||
VSForm vs;
|
||||
for (direction i=0; i<VSForm::nComponents; i++)
|
||||
{
|
||||
vs[i] = this->operator[](start + i);
|
||||
}
|
||||
return vs;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>> Foam::Field<Type>::T() const
|
||||
{
|
||||
|
||||
@ -333,6 +333,9 @@ public:
|
||||
//- Replace a component field of the field
|
||||
void replace(const direction, const cmptType&);
|
||||
|
||||
template<class VSForm>
|
||||
VSForm block(const label start) const;
|
||||
|
||||
//- Return the field transpose (only defined for second rank tensors)
|
||||
tmp<Field<Type>> T() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user