CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

std::ceil fails when using #calc in blockMeshDict

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2018, 10:25
Default std::ceil fails when using #calc in blockMeshDict
  #1
Member
 
Axel
Join Date: May 2016
Location: Augsburg, Germany
Posts: 46
Rep Power: 9
Illmatic is on a distinguished road
Hi everybody,

I am trying to calculate the appropiate number of cells in a blockMeshDict using the #calc operation.

Basically what I am doing is this:
Code:
x1		1.7;
y1		2.1; 
x2		2.1;
y2		2.05;
x3		2.5;
y3		2.3;

nBlock1XCells	20;
nBlock1YCells	#calc "std::ceil((y1 - y2) * 20)";
Unfortunatly this fails with the error message:
Quote:
/home/fiedler/OpenFOAM/ThirdParty-v1712/platforms/linux64/gcc-6.3.0/include/c++/6.3.0/limits:1601:7: internal compiler error: Illegal instruction
max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
^~~
0xac5ddf crash_signal
/home/pgh/OpenFOAM/ThirdParty-1706/gcc-6.3.0/gcc/toplev.c:333
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
/home/fiedler/OpenFOAM/OpenFOAM-v1712/wmake/rules/General/transform:28: recipe for target 'Make/linux64Gcc63DPInt32Opt/codeStreamTemplate.o' failed
make: *** [Make/linux64Gcc63DPInt32Opt/codeStreamTemplate.o] Error 1


--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/_6461bf4ad58cf530a2ae18008262b8b0fd99eb82/platforms/linux64Gcc63DPInt32Opt/lib/libcodeStream_6461bf4ad58cf530a2ae18008262b8b0fd99 eb82.so"


file: /mnt/c/Users/fiedl/OneDrive/OF_Cases/neuralNetwork/mesh/system/blockMeshDict

From function static void (* Foam::functionEntries::codeStream::getFunction(con st Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&)
in file db/dictionary/functionEntries/codeStream/codeStream.C at line 219.

FOAM exiting
What am I doing wrong?

Best regards,
Axel
Illmatic is offline   Reply With Quote

Old   December 3, 2019, 10:14
Default
  #2
New Member
 
Join Date: Nov 2019
Posts: 3
Rep Power: 6
bartimore is on a distinguished road
I have the same error, but the problem is slightly more general. For me the error comes from using #calc in the first place. Even simple multiplications result in the same error
bartimore is offline   Reply With Quote

Old   December 4, 2019, 07:02
Default
  #3
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
You need to use your variables properly. The rules of OpenFOAM's macro expansion apply.

Code:
NZ4  #calc "std::ceil( ($Z4 - $Z3) / $dz )";
HPE likes this.
GerhardHolzinger is offline   Reply With Quote

Old   December 29, 2019, 17:04
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
FYI// The new #eval expression replacing #calc is pretty powerful and much more faster than #calc //FYI
HPE is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a if loop in the blockMeshDict file eroussel OpenFOAM Programming & Development 0 April 20, 2018 11:39
[blockMesh] blockMesh with parametric mesh. Unusual and unseen problem 13msmemusman OpenFOAM Meshing & Mesh Conversion 1 June 13, 2016 02:25
Drag force coefficient too high for a flow past a cylinder using komega sst Scabbard OpenFOAM Running, Solving & CFD 37 March 21, 2016 16:16
cannot converge a pimpleFoam simulation iper88 OpenFOAM Running, Solving & CFD 1 November 26, 2015 08:04
[blockMesh] Cylindrical mesh with an odd number of circumferential cells Eldor OpenFOAM Meshing & Mesh Conversion 1 April 16, 2015 04:21


All times are GMT -4. The time now is 17:05.