Calculate gradient on user-created vector field
Posted: Mon Feb 22, 2016 5:03 pm
Hi,
I am using CS 4.0.4 and I would like to calculate the gradient of a vector field I have created in uspisu and initialized with cs_user_initialization, according to the given examples in the files. I tried field_gradient_vector on my created field in cs_user_extra_operations:
however, it returns an error as some field information (var_cal_opt) is missing:
Do I need to run any other subroutines in advance? In fldini.f90, I found the function field_set_key_struct_var_cal_opt, but I am not sure if this is intended to use for custom fields. Maybe you can give me an advice on this issue.
Thank you in advance,
Philipp
I am using CS 4.0.4 and I would like to calculate the gradient of a vector field I have created in uspisu and initialized with cs_user_initialization, according to the given examples in the files. I tried field_gradient_vector on my created field in cs_user_extra_operations:
Code: Select all
call field_gradient_vector(id_vel_user, 0 , imrgra , 1, gradv)
Code: Select all
../.././../code_saturne-4.0.4/src/base/cs_field.c:3025: Fatal error.
Field "vel_user" with type flag 9
has no value associated with key 25 ("var_cal_opt").
Call stack:
1: 0x7f205261af9c <cs_field_get_key_struct+0xec> (libsaturne.so.0)
2: 0x7f2052abb1a5 <__cs_c_bindings_MOD_field_get_key_struct_var_cal_opt+0x49> (libsaturne.so.0)
3: 0x40387a <cs_f_user_extra_operations_+0x6a9> (cs_solver)
4: 0x7f20525c9df0 <caltri_+0x31b0> (libsaturne.so.0)
5: 0x7f20525a1cae <cs_run+0x3fe> (libsaturne.so.0)
6: 0x7f20525a17a2 <main+0x112> (libsaturne.so.0)
7: 0x7f2051e7fec5 <__libc_start_main+0xf5> (libc.so.6)
8: 0x402ac9 <> (cs_solver)
End of stack
Thank you in advance,
Philipp