multicomponentThermo: Fix for singleComponentMixture
This prevents a segfault when using singleComponentMixture and no mass fraction fields are stored Resolves bug report https://bugs.openfoam.org/view.php?id=4006
This commit is contained in:
@ -74,21 +74,29 @@ public:
|
||||
inline GeometricFieldListSlicer()
|
||||
{}
|
||||
|
||||
//- Construct from a list of fields
|
||||
inline GeometricFieldListSlicer(const PtrList<geoFieldType>& geoFields)
|
||||
//- Construct from a mesh and a list of fields
|
||||
inline GeometricFieldListSlicer
|
||||
(
|
||||
const typename geoFieldType::Mesh& mesh,
|
||||
const PtrList<geoFieldType>& geoFields
|
||||
)
|
||||
{
|
||||
set(geoFields);
|
||||
set(mesh, geoFields);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Set the field pointers
|
||||
inline void set(const PtrList<geoFieldType>& geoFields)
|
||||
inline void set
|
||||
(
|
||||
const typename geoFieldType::Mesh& mesh,
|
||||
const PtrList<geoFieldType>& geoFields
|
||||
)
|
||||
{
|
||||
fields_.resize(geoFields.size());
|
||||
|
||||
patchFields_.resize(geoFields[0].boundaryField().size(), fields_);
|
||||
patchFields_.resize(mesh.boundary().size(), fields_);
|
||||
|
||||
forAll(geoFields, fieldi)
|
||||
{
|
||||
|
||||
@ -107,7 +107,7 @@ inline Foam::label Foam::multicomponentThermo::specieIndex
|
||||
inline Foam::volScalarFieldListSlicer
|
||||
Foam::multicomponentThermo::implementation::Yslicer() const
|
||||
{
|
||||
return volScalarFieldListSlicer(Y_);
|
||||
return volScalarFieldListSlicer(mesh(), Y_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ inline const Foam::volScalarField& Foam::psiuMulticomponentThermo::Y
|
||||
inline Foam::volScalarFieldListSlicer
|
||||
Foam::psiuMulticomponentThermo::implementation::Yslicer() const
|
||||
{
|
||||
return volScalarFieldListSlicer(Y_);
|
||||
return volScalarFieldListSlicer(mesh(), Y_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user