Hello,
I want to export the velocity field for specific cells in every 100 iterations.
So, I need the coordinates of the cells for processing the results.
Is there a function or something like that to get the x,y,z coordinates of each cell by giving the cell id?
Regards,
Mohammad
How to get the coordinates of specific cells?
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 284
- Joined: Fri Dec 04, 2015 1:42 pm
Re: How to get the coordinates of specific cells?
Hello,
Yes, there is. Depending if you are working on C or Fortran. Check in the Example directory for xyzcen() (fortran) or for cell_cen() (C), you will find a lot of example of use.
Also in the Doxygen documentation https://www.code-saturne.org/cms/sites/ ... /mesh.html
Regards,
Luciano
Yes, there is. Depending if you are working on C or Fortran. Check in the Example directory for xyzcen() (fortran) or for cell_cen() (C), you will find a lot of example of use.
Also in the Doxygen documentation https://www.code-saturne.org/cms/sites/ ... /mesh.html
Regards,
Luciano
Re: How to get the coordinates of specific cells?
Hello,
Dear Luciano,
Thank you very much! I appreciate your help.
Just one more question:
I want to export the velocity magnitude of each cell + the coordinates of them in every 100 iterations to a file (each cell data in a row with 4 columns). As you know, I should use a loop over cells and if I use parallel processing there will be some ghost cells.
I want to know that will there be duplicated data (rows) in the exported file due to ghost cells?
If the answer is yes, then how can I prevent writing of ghost cells data into the file?
Regards,
Mohammad
Dear Luciano,
Thank you very much! I appreciate your help.
Just one more question:
I want to export the velocity magnitude of each cell + the coordinates of them in every 100 iterations to a file (each cell data in a row with 4 columns). As you know, I should use a loop over cells and if I use parallel processing there will be some ghost cells.
I want to know that will there be duplicated data (rows) in the exported file due to ghost cells?
If the answer is yes, then how can I prevent writing of ghost cells data into the file?
Regards,
Mohammad
-
- Posts: 284
- Joined: Fri Dec 04, 2015 1:42 pm
Re: How to get the coordinates of specific cells?
Hello,
In the Doxygen documentation that I posted previously is the data about your question. If you use ncel (cs_glob_mesh->n_cells) you will get the local number of cells in case of parallelism. If you use ncelet (cs_glob_mesh->n_cells_with_ghosts) you will get the local number of cells plus the ghost cells.
Also check the cs_user_extra_operations-parallel_operations.f90 in the Example directory.
Regards,
Luciano.
In the Doxygen documentation that I posted previously is the data about your question. If you use ncel (cs_glob_mesh->n_cells) you will get the local number of cells in case of parallelism. If you use ncelet (cs_glob_mesh->n_cells_with_ghosts) you will get the local number of cells plus the ghost cells.
Also check the cs_user_extra_operations-parallel_operations.f90 in the Example directory.
Regards,
Luciano.
Re: How to get the coordinates of specific cells?
Hello,
Thank you again Luciano!
Regards,
Mohammad
Thank you again Luciano!
Regards,
Mohammad