Added support for interpolating from volField::GeometricBoundaryField to surfaceField::GeometricBoundaryField

This commit is contained in:
Henry
2012-07-30 12:29:53 +01:00
parent acec70b439
commit e3b5df7224
6 changed files with 98 additions and 13 deletions

View File

@ -98,20 +98,19 @@ calculatedFvPatchField<Type>::calculatedFvPatchField
template<class Type>
template<class Type2>
tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
(
const fvPatchField<Type2>& pf
const fvPatch& p
)
{
typename patchConstructorTable::iterator patchTypeCstrIter =
patchConstructorTablePtr_->find(pf.patch().type());
patchConstructorTablePtr_->find(p.type());
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
{
return patchTypeCstrIter()
(
pf.patch(),
p,
DimensionedField<Type, volMesh>::null()
);
}
@ -121,7 +120,7 @@ tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
(
new calculatedFvPatchField<Type>
(
pf.patch(),
p,
DimensionedField<Type, volMesh>::null()
)
);
@ -129,6 +128,17 @@ tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
}
template<class Type>
template<class Type2>
tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
(
const fvPatchField<Type2>& pf
)
{
return NewCalculatedType(pf.patch());
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>

View File

@ -257,6 +257,13 @@ public:
const dictionary&
);
//- Return a pointer to a new calculatedFvPatchField created on
// freestore without setting patchField values
static tmp<fvPatchField<Type> > NewCalculatedType
(
const fvPatch&
);
//- Return a pointer to a new calculatedFvPatchField created on
// freestore without setting patchField values
template<class Type2>

View File

@ -97,21 +97,20 @@ calculatedFvsPatchField<Type>::calculatedFvsPatchField
template<class Type>
template<class Type2>
tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType
(
const fvsPatchField<Type2>& pf
const fvPatch& p
)
{
typename patchConstructorTable::iterator patchTypeCstrIter =
patchConstructorTablePtr_->find(pf.patch().type());
patchConstructorTablePtr_->find(p.type());
if (patchTypeCstrIter != patchConstructorTablePtr_->end())
{
return patchTypeCstrIter()
(
pf.patch(),
Field<Type>::null()
p,
DimensionedField<Type, surfaceMesh>::null()
);
}
else
@ -120,14 +119,25 @@ tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType
(
new calculatedFvsPatchField<Type>
(
pf.patch(),
Field<Type>::null()
p,
DimensionedField<Type, surfaceMesh>::null()
)
);
}
}
template<class Type>
template<class Type2>
tmp<fvsPatchField<Type> > fvsPatchField<Type>::NewCalculatedType
(
const fvsPatchField<Type2>& pf
)
{
return NewCalculatedType(pf.patch());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -247,6 +247,13 @@ public:
const dictionary&
);
//- Return a pointer to a new calculatedFvsPatchField created on
// freestore without setting patchField values
static tmp<fvsPatchField<Type> > NewCalculatedType
(
const fvPatch&
);
//- Return a pointer to a new calculatedFvsPatchField created on
// freestore without setting patchField values
template<class Type2>

View File

@ -302,6 +302,43 @@ interpolate
}
template<class Type>
tmp<FieldField<fvsPatchField, Type> > interpolate
(
const FieldField<fvPatchField, Type>& fvpff
)
{
FieldField<fvsPatchField, Type>* fvspffPtr
(
new FieldField<fvsPatchField, Type>(fvpff.size())
);
forAll(*fvspffPtr, patchi)
{
fvspffPtr->set
(
patchi,
fvsPatchField<Type>::NewCalculatedType(fvpff[patchi].patch()).ptr()
);
(*fvspffPtr)[patchi] = fvpff[patchi];
}
return tmp<FieldField<fvsPatchField, Type> >(fvspffPtr);
}
template<class Type>
tmp<FieldField<fvsPatchField, Type> > interpolate
(
const tmp<FieldField<fvPatchField, Type> >& tfvpff
)
{
tmp<FieldField<fvPatchField, Type> > tfvspff = interpolate(tfvpff());
tfvpff.clear();
return tfvspff;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fvc

View File

@ -163,12 +163,26 @@ namespace fvc
const tmp<GeometricField<Type, fvPatchField, volMesh> >& tvf
);
//- Interpolate tmp field onto faces using 'interpolate(\<name\>)'
//- Interpolate field onto faces using 'interpolate(\<name\>)'
template<class Type>
static tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate
(
const GeometricField<Type, fvPatchField, volMesh>& tvf
);
//- Interpolate boundary field onto faces (simply a type conversion)
template<class Type>
static tmp<FieldField<fvsPatchField, Type> > interpolate
(
const FieldField<fvPatchField, Type>& fvpff
);
//- Interpolate boundary field onto faces (simply a type conversion)
template<class Type>
static tmp<FieldField<fvsPatchField, Type> > interpolate
(
const tmp<FieldField<fvPatchField, Type> >& tfvpff
);
}