|
[Sponsors] |
September 27, 2010, 13:49 |
Dynamic Arrays in OF 1.6 [SOLVED]
|
#1 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Hello everyone,
I am having trouble with a custom post-processor. I want to be able to read in a tab separated file from memory and refer to its values (look-up table essentially). Since the size of the file may change, I was thinking of using dynamic arrays, and was able to write the code for it to work in a program on its own. The problem I run into is when I try run the program in FOAM. I've included all the necessary header files, and the program compiles just fine. When I run it and I need to allocate space, I get the following errors: new cannot satisfy memory request. This does not necessarily mean you have run out of virtual memory. It could be due to a stack violation caused by e.g. bad use of pointers or an out of date shared library My table isn't very big, which is why I'm going the array route. Has anyone run into this before. Barring that, how could I implement this type of functionality with the built in foam libraries? Last edited by mturcios777; September 28, 2010 at 13:13. Reason: Found solution to problem |
|
September 28, 2010, 13:09 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Ok, figured it out. Easiest way to do this is with the interpolationTable library.
Code:
fileName myFile = someDict.lookup("file.ext"); interpolationTable<scalar> myTab(myFile); Code:
N ( (x1 y1) (x2 y2) ... (xN yN) ) Code:
scalar yiVar = myTab(xi); For future reference, I'm going to see if I can do something similar for multidimensional interpolation. Out of curiosity, what is the best way to indicate that I've solved my problem so people browsing the forum for this answer can find it faster? Last edited by mturcios777; September 28, 2010 at 13:15. Reason: Question for forum tools |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh Problem. | Tom Clark | FLUENT | 10 | June 21, 2021 04:27 |
k-omega-SST model (OF 1.6) - turbulent flat plate | cboss | OpenFOAM Running, Solving & CFD | 25 | August 9, 2016 09:53 |
Regarding Negative volume detected in Dynamic mesh | Vinay Morabad | FLUENT | 10 | December 16, 2015 00:31 |
Dynamic Mesh moving interface help | akash.iitb | FLUENT | 0 | August 23, 2010 23:53 |
Dynamic mesh + grid adapt = Crash! (Files included | BillH | FLUENT | 4 | July 24, 2007 15:31 |