mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH:Field: added default values to mapping constructor
This commit is contained in:
@ -124,6 +124,34 @@ Foam::Field<Type>::Field
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Field<Type>::Field
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const FieldMapper& mapper,
|
||||
const Type& defaultValue
|
||||
)
|
||||
:
|
||||
List<Type>(mapper.size(), defaultValue)
|
||||
{
|
||||
map(mapF, mapper);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Field<Type>::Field
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const FieldMapper& mapper,
|
||||
const UList<Type>& defaultValues
|
||||
)
|
||||
:
|
||||
List<Type>(defaultValues)
|
||||
{
|
||||
map(mapF, mapper);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Field<Type>::Field
|
||||
(
|
||||
@ -137,6 +165,34 @@ Foam::Field<Type>::Field
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Field<Type>::Field
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const FieldMapper& mapper,
|
||||
const Type& defaultValue
|
||||
)
|
||||
:
|
||||
List<Type>(mapper.size(), defaultValue)
|
||||
{
|
||||
map(tmapF, mapper);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Field<Type>::Field
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const FieldMapper& mapper,
|
||||
const UList<Type>& defaultValues
|
||||
)
|
||||
:
|
||||
List<Type>(defaultValues)
|
||||
{
|
||||
map(tmapF, mapper);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::Field<Type>::Field(const Field<Type>& f)
|
||||
:
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -160,6 +160,22 @@ public:
|
||||
const FieldMapper& map
|
||||
);
|
||||
|
||||
//- Construct by mapping from the given field
|
||||
Field
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const FieldMapper& map,
|
||||
const Type& defaultValue
|
||||
);
|
||||
|
||||
//- Construct by mapping from the given field
|
||||
Field
|
||||
(
|
||||
const UList<Type>& mapF,
|
||||
const FieldMapper& map,
|
||||
const UList<Type>& defaultValues
|
||||
);
|
||||
|
||||
//- Construct by mapping from the given tmp field
|
||||
Field
|
||||
(
|
||||
@ -167,6 +183,24 @@ public:
|
||||
const FieldMapper& map
|
||||
);
|
||||
|
||||
//- Construct by mapping from the given tmp field. Supplied uniform
|
||||
// value for unmapped items
|
||||
Field
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const FieldMapper& map,
|
||||
const Type& defaultValue
|
||||
);
|
||||
|
||||
//- Construct by mapping from the given tmp field. Supplied values
|
||||
// for unmapped items
|
||||
Field
|
||||
(
|
||||
const tmp<Field<Type> >& tmapF,
|
||||
const FieldMapper& map,
|
||||
const UList<Type>& defaultValues
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
Field(const Field<Type>&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user