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

Segmentation fault while interpolating

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2019, 06:12
Default Segmentation fault while interpolating
  #1
New Member
 
chen yu Huang
Join Date: Nov 2019
Posts: 18
Rep Power: 6
chenu is on a distinguished road
Hello,
my solver diverges while interpolating.
In my case I have created a new solver which based on icoFoam. After calculating pressure the solver calls my own function to derive some specified points. The velocity of these points are then derived by interpolating and transfer to my own function. At beginning there is no problem, but after 0.5 second flowtime, I got error and it seems that interpolation is fail, so I did some tests
1. If I set 0.5 as startTime and run again my solver, it works but it may stop again if endTime is longer(In my case endTime is 1 second).
2. I have used pthread in my solver(the error #2). I disabled it but the solver still diverges.
3.If I hide all command lines and interpolation except calling my own program, it works, so the Segmentation fault is not from my own program
4.To test solver I set 10 points. I have printed each time step of position and velocity. The solver stops after interpolating first position.

The following are some parts of interpolation and error message. I will be grateful if someone give me advise. Thank you!!

Here is my program:
Quote:
//Here I declare pointField and vectorField to store the position and velocity
pointField pt(n_pt,point(0.0,0.0,0.0));
vectorField pv(n_pt,vector(0.0,0.0,0.0));


while (runTime.loop())
{
~~~The content here is identical to icoFoam~~~
my_prog(); //Calling my own program
runTime.write();
//require_position is a function from my program, which will update the coordinate of position in my
own program, n_pt is number of points
require_position(&(pt[0].x()));
for(i=0;i<n_pt;i++){
pv[i]=Uint.interpolate(pt[i],mesh.findCell(pt[i]));
}

//the value of velocity is then sent to my own program.
send_velocit(&pv[0].x());
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}


Here is Error message:
Quote:
#0 Foam::error:PrintStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libpthread.so.0"
#3 Foam:PolyMeshTetDecomposition::cellTetIndices(Foam :PolyMesh const&, int) at ??:?
#4 Foam::cellPointWeight::findTetrahedron(Foam:PolyMe sh const&, Foam::Vector<double> const&, int) at ??:?
#5 ? in "/myworkdict/linux64GccDPInt32Opt/bin/icointer"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? in "/myworkdict/linux64GccDPInt32Opt/bin/icointer"
^C
[1]+ Segmentation fault (core dumped) icointer > log
chenu is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel francesco OpenFOAM Bugs 4 May 2, 2017 22:59
Segmentation fault in SU2 V5.0 ygd SU2 2 March 1, 2017 05:38
Segmentation fault when running in parallel Pj. OpenFOAM Running, Solving & CFD 3 April 8, 2015 09:12
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example sudo OpenFOAM Running, Solving & CFD 3 April 2, 2013 18:27
segmentation fault when installing OF-2.1.1 on a cluster Rebecca513 OpenFOAM Installation 9 July 31, 2012 16:06


All times are GMT -4. The time now is 22:33.