|
[Sponsors] |
July 20, 2016, 14:10 |
cannot convert DataEntry to scalar
|
#1 | |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 17 |
Hi,
I'm trying to modify a boundary condition, so I've started off with oscillatingFixedValue. I wanted this new boundary condition to be only for velocity so I've changed/removed all the template<class Type>. Now when I try to compile, it complains: Quote:
|
||
July 21, 2016, 03:11 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17 |
Because it is a template class and you basically need a special instance (vector), you have to replace Type by vector.
|
|
July 21, 2016, 08:08 |
|
#3 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21 |
Have a look at the fixedNormalInletOutletVelocityFvPatchVectorField class. This might be a good starting point (if you want to specify the same velocity for all faces of your boundary patch).
|
|
July 21, 2016, 14:30 |
|
#4 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 17 |
Hassan: it is by default scalar not vector, (the same thing in the original boundary condition) hence the error <double>.
@Joachim: OscillatingFixedValue works fine for me, it's the autoPtr<DataEntry<scalar>> part that I haven't touched and complains after changes in non-related parts!!!! I solved the issue by commenting the member functions as the ->value() of the DataEntry part would've done the same thing. |
|
July 22, 2016, 05:32 |
|
#5 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17 |
I did not mean in DataEntry. In your first post you said that your removed template<class Type> which mean you have to modify the entire class. Maybe I am not clear about your modifications.
|
|
July 22, 2016, 10:45 |
|
#6 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 17 |
Yep you're right, but the DataEntry part is not using template Type before I remove the template part. It's autoPtr<DataEntry<scalar>> from the very beginning, so I haven't touched it at all.
|
|
July 22, 2016, 11:44 |
|
#7 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17 |
It is an interesting issue which may requires more investigation. I tried to reduce the template class to normal class and I get the same error. Actually this error make scene from the compiler point of view because ``frequency_`` for example is not scalar. Therefore the compiler complain about the return data type. For now, you can just remove these four function causing the error (if you don't need them) or change the return type. Also, you may consider using the template class as it is.
|
|
July 25, 2016, 12:20 |
|
#8 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 17 |
Yes that's what I did, commenting those lines.
But there's a new issue after that which I've been struggling. I'll make a new topic since it's a different issue. Thanks for following up. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
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 |