|
[Sponsors] |
January 7, 2016, 05:29 |
How do I convert scalar to word
|
#1 |
New Member
Balajee
Join Date: Dec 2013
Posts: 13
Rep Power: 13 |
I want to convert a number to a string in openfoam.
Code:
scalar count(11); word fieldName(count); Info << fieldName << endl; word::stripInvalid() called for word For debug level (= 2) > 1 this is considered fatal Aborted (core dumped) What seems to be the problem here? Thankyou |
|
January 8, 2016, 03:11 |
|
#2 |
New Member
Balajee
Join Date: Dec 2013
Posts: 13
Rep Power: 13 |
Never mind. Converting scalar to word should be done like this
Code:
word fieldName(name(i)); |
|
September 28, 2019, 15:33 |
name function
|
#3 |
New Member
hamed eshraghi
Join Date: Jan 2016
Posts: 3
Rep Power: 10 |
you can use name function. like this:
Code:
scalar a(0); word b =Foam::name(a); $FOAM_SRC/OpenFOAM/primitives/ints |
|
Tags |
scalar word conversion |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 05:18 |
Issue symmetryPlane 2.5d extruded airfoil simulation | 281419 | OpenFOAM Running, Solving & CFD | 5 | November 28, 2015 14:09 |
Diverging solution in transonicMRFDyMFoam | tsalter | OpenFOAM Running, Solving & CFD | 30 | July 7, 2014 07:20 |
compressible flow in turbocharger | riesotto | OpenFOAM | 50 | May 26, 2014 02:47 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 02:27 |