Cannot access user defined field
Posted: Wed Feb 08, 2017 1:57 pm
Hello everybody,
In the model I am developing I make use of several custom property fields. Currently I am experiencing problems with one I added lately: when I try to initialize it in one of my subroutines, I get the following error:
Running the calculation through gdb, I found out that before the failure, cs_user_model is executed and cs_parameters_add_property is called on that field, but, after I try to retrieve it in my subroutine by calling field_get_val_s_by_name, the pointer I pass remains "<not associated>".
The errors occurs a few lines below when I try to assign a value to the first element of the vector.
My subroutine is called during the first run of cs_user_head_losses. When I wrote it, I had a similar problem when trying to fill the porosity field, which I solved storing the calculated values in a temporary vector. When I initialize other custom fields, in subroutines called at later stages, all is fine. Can it be that I am trying to access the field "too early"?
Thanks in advance to anyone answering.
Regards,
Cosimo
In the model I am developing I make use of several custom property fields. Currently I am experiencing problems with one I added lately: when I try to initialize it in one of my subroutines, I get the following error:
Code: Select all
Fortran runtime error: Index '1' of dimension 1 of array 'filter_cell_volume' above upper bound of 0
The errors occurs a few lines below when I try to assign a value to the first element of the vector.
My subroutine is called during the first run of cs_user_head_losses. When I wrote it, I had a similar problem when trying to fill the porosity field, which I solved storing the calculated values in a temporary vector. When I initialize other custom fields, in subroutines called at later stages, all is fine. Can it be that I am trying to access the field "too early"?
Thanks in advance to anyone answering.
Regards,
Cosimo