|
[Sponsors] |
February 22, 2018, 08:39 |
Initializing dimensionedtypes
|
#1 |
Member
Victor Koppejan
Join Date: May 2015
Posts: 40
Rep Power: 11 |
Hi Everyone,
I work a lot with vectorList and scalarList and I would like to replace them by their dimensioned version, so List<dimensionedVector> and List<dimensionedScalar>. At the moment I declare the lists in the headerfile but this is a problem for the dimensioned versions. Declaring: Code:
List<dimensionedVector> Code:
template<class Type> Foam::dimensioned<Type>::dimensioned () : name_("undefined"), dimensions_(dimless), value_(pTraits<Type>::zero) {} Code:
template<class Type> Foam::dimensioned<Type>::dimensioned ( const word& name, const dimensionSet& dimSet, const Type t ) : name_(name), dimensions_(dimSet), value_(t) {} Victor |
|
February 12, 2020, 12:46 |
|
#2 |
Member
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 9 |
Hi Victor!
I guess I'm experiencing the same kind of trouble, as I'm not able to declare a List<dimensionedScalar> without having it initialized with the null constructor, which then prevents me to assign to the list elements with different dimensions. After all this time, did you manage to solve your problem? Andrea |
|
February 16, 2020, 04:34 |
|
#3 |
Member
Victor Koppejan
Join Date: May 2015
Posts: 40
Rep Power: 11 |
Hi, sorry for the late reply. I didn't find a solution.
|
|
August 6, 2023, 18:25 |
|
#4 | |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
Quote:
I do not know if it helps but I create the list of 10 dimensioned scalars with value 0 like this in the constructor Code:
myListDS_{List<dimensionedScalar>(10, dimensionedScalar(dimLength, 0).value())} Code:
value()
__________________
best regards pblasiak |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD by anderson, chp 10.... supersonic flow over flat plate | varunjain89 | Main CFD Forum | 18 | May 11, 2018 08:31 |
Initializing large models | mahmoudtmt | FLUENT | 3 | July 16, 2017 23:35 |
ignorance the initializing | sinatahmooresi | OpenFOAM Running, Solving & CFD | 0 | May 22, 2016 07:13 |
Initializing or patching cell zones | kozalp | FLUENT | 0 | December 30, 2013 17:00 |
query regarding role of initializing in a solving | Kishore | FLUENT | 2 | July 5, 2007 00:23 |