|
[Sponsors] |
May 24, 2014, 16:34 |
floor function problem
|
#1 |
Senior Member
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17 |
Hi,
Trying to implement the following code snippet in a Ueqns routine: Code:
volScalarField Ad ( "Ad", floor( min( scalar(1.0), mag(Ua)/limitV ) ) ); Code:
UEqns.H:9:48: error: cannot convert ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ to ‘double’ for argument ‘1’ to ‘double floor(double)’ Any ideas how it can be fixed? Thanks |
|
May 24, 2014, 19:34 |
|
#2 |
Senior Member
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17 |
Posting the solution just in case it comes in handy for someone else.
It seems floor() does not map over an entire array like min() does. The following modification compiled without any problems. Still have to test the code to see if I get the correct anticipated result. Code:
volScalarField Ad ( "Ad", //floor( min( scalar(1.0), mag(Ua)/limitV ) ) min( scalar(1.0), mag(Ua)/limitV ) ); forAll ( mesh.C(), celli ) { Ad[celli] = floor( Ad[celli] ); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |