|
[Sponsors] |
Operation of Modified Bessel Function on a ScalarField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 19, 2020, 06:35 |
Operation of Modified Bessel Function on a ScalarField
|
#1 |
New Member
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 5 |
Hello Foamers!
I am using Modified Bessel Functions 'cyl_bessel_k' from the boost C++ library in my OpenFOAM program. I need to get the Modified Bessel Function values for all the values of a scalarField. Do I need to run a loop for that? I seek suggestions in this regard. |
|
September 22, 2020, 14:06 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40 |
Something like this?
Code:
scalarField fld =... ; // some field for (scalar& val : fld) { val = your_func(val); } |
|
September 23, 2020, 09:23 |
|
#3 |
New Member
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 5 |
The functional value of a field should be another field. But in the above example, the value of the function has been defined as a scalar only.
Is it correctly done? |
|
September 24, 2020, 18:58 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40 |
Quote:
Code:
scalarField input =.... ; scalarField output(input.size()); auto iter = output.begin(); for (const scalar val : input) { *iter = my_func(val); ++iter; } |
||
September 28, 2020, 03:30 |
|
#5 |
Senior Member
|
You can create the output scalarField by extending the file createField.H as AndreaCFD shows in his thread "Linearized Navier Stokes Solver". Once the solver has terminated, you should be able to see the file with the computed output scalar field. This file can visualized using ParaView.
Can you please provide more details on what exactly your intention is? What does it mean to apply the modified Bessel function to a scalarField in your case? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
loading issue libraries:libsimpleFunctionObjects.so libsimpleSwakFunctionObjects.so | immortality | OpenFOAM Pre-Processing | 15 | April 7, 2024 12:35 |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 07:15 |
OpenFoam "Permission denied" and "command not found" problems. | iyidaniel@yahoo.co.uk | OpenFOAM Running, Solving & CFD | 11 | January 2, 2018 06:47 |
Incompatible dimensions for operation | ruben23 | OpenFOAM Running, Solving & CFD | 2 | June 12, 2015 04:14 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 01:27 |