Skip to content
Permalink
Browse files

dimensionedType: Added constructor from dimensions and value

The name is generated from the value.
  • Loading branch information...
Henry Weller
Henry Weller committed Dec 19, 2018
1 parent 60e4b0b commit 3708da6175a6f6b856555b26cdfa3ed9be1c55d3
@@ -76,7 +76,7 @@ Foam::dimensioned<Type>::dimensioned
(
const word& name,
const dimensionSet& dimSet,
const Type t
const Type& t
)
:
name_(name),
@@ -85,6 +85,28 @@ Foam::dimensioned<Type>::dimensioned
{}


template<class Type>
Foam::dimensioned<Type>::dimensioned
(
const dimensionSet& dimSet,
const Type& t
)
:
name_(::Foam::name(t)),
dimensions_(dimSet),
value_(t)
{}


template<class Type>
Foam::dimensioned<Type>::dimensioned(const Type& t)
:
name_(::Foam::name(t)),
dimensions_(dimless),
value_(t)
{}


template<class Type>
Foam::dimensioned<Type>::dimensioned
(
@@ -91,20 +91,20 @@ public:

// Constructors

//- Construct given a name, a value and its dimensionSet.
dimensioned(const word&, const dimensionSet&, const Type);
//- Construct given name, dimensions and value
dimensioned(const word&, const dimensionSet&, const Type&);

//- Construct given dimensions and value
// with the name obtained from the value
dimensioned(const dimensionSet&, const Type&);

//- Construct dimensionless given value only
// with a name obtained from the value
dimensioned(const Type&);

//- Construct from a dimensioned<Type> changing the name.
dimensioned(const word&, const dimensioned<Type>&);

//- Construct given a value (creates dimensionless value).
dimensioned(const Type& t)
:
name_(::Foam::name(t)),
dimensions_(dimless),
value_(t)
{}

//- Construct from Istream.
dimensioned(Istream&);

0 comments on commit 3708da6

Please sign in to comment.
You can’t perform that action at this time.