Hello,
Thanks Yvan.
The field id error is gone now, but now I get this error for gradient calculation:
SIGSEGV signal (forbidden memory area access) intercepted!
Call stack:
1: 0x557474f2e40d <cs_field_gradient_scalar+0x11d> (cs_solver)
2: 0x557474f338ac <viswal_+0x1cdf> (cs_solver)
3: 0x7ff54b80eb0b <phyvar_+0x13d5> (libsaturne-6.0.so)
4: 0x7ff54b833123 <tridim_+0xaee> (libsaturne-6.0.so)
5: 0x7ff54b6c0112 <caltri_+0x27c9> (libsaturne-6.0.so)
6: 0x7ff54cdf16ef <cs_run+0x5ef> (libcs_solver-6.0.so)
7: 0x7ff54cdf0fb8 <main+0x178> (libcs_solver-6.0.so)
8: 0x7ff54a5aab97 <__libc_start_main+0xe7> (libc.so.6)
9: 0x557474f2d5fa <_start+0x2a> (cs_solver)
End of stack
Let me provide more details. As I mentioned before, I've defined a property in
cs_user_parameters.c file:
Code: Select all
cs_parameters_add_property("P1",
1,
CS_MESH_LOCATION_CELLS);
Then I called the gradient of scalar for this property in viswal.f90 file (I changed some codes of this file) as below:
Code: Select all
integer P1_fid
double precision, allocatable, dimension(:,:) :: grads
iprev = 0
inc = 1
iccocg = 1
allocate(grads(3,ncelet))
call field_get_id("P1",P1_fid)
call field_gradient_scalar(P1_fid, iprev, imrgra, inc, iccocg, grads)
Now by running the code those error occur. But if I define the property as a variable like below, it works without any problems:
Code: Select all
cs_parameters_add_variable("P1", 1);
But it slows down the code.
Regards,
Mohammad