mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +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>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type>> Foam::Field<Type>::T() const
|
Foam::tmp<Foam::Field<Type>> Foam::Field<Type>::T() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -333,6 +333,9 @@ public:
|
|||||||
//- Replace a component field of the field
|
//- Replace a component field of the field
|
||||||
void replace(const direction, const cmptType&);
|
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)
|
//- Return the field transpose (only defined for second rank tensors)
|
||||||
tmp<Field<Type>> T() const;
|
tmp<Field<Type>> T() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user