|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Go to the source code of this file.
Functions | |
| PetscInt | CreateVTKFileFromMetadata (const char *filename, const VTKMetaData *meta, MPI_Comm comm) |
| Creates and writes a VTK file (either .vts or .vtp) from a populated metadata struct. | |
| PetscErrorCode | PrepareOutputCoordinates (UserCtx *user, PetscScalar **out_coords, PetscInt *out_nx, PetscInt *out_ny, PetscInt *out_nz, PetscInt *out_npoints) |
| Creates a C array of coordinates corresponding to a subsampled (legacy-style) grid. | |
| PetscErrorCode | PrepareOutputEulerianFieldData (UserCtx *user, Vec field_vec, PetscInt num_components, PetscScalar **out_data) |
| Creates a C array of field data corresponding to a subsampled (legacy-style) grid. | |
| PetscErrorCode | PrepareOutputParticleData (UserCtx *user, PostProcessParams *pps, VTKMetaData *meta, PetscInt *p_n_total) |
| Gathers, subsamples, and prepares all particle data for VTK output. | |
| PetscInt CreateVTKFileFromMetadata | ( | const char * | filename, |
| const VTKMetaData * | meta, | ||
| MPI_Comm | comm | ||
| ) |
Creates and writes a VTK file (either .vts or .vtp) from a populated metadata struct.
| [in] | filename | The output file name. |
| [in] | meta | Pointer to a VTKMetaData structure containing all necessary fields. |
| [in] | comm | The MPI communicator. |
Creates and writes a VTK file (either .vts or .vtp) from a populated metadata struct.
Creates a VTK file from prepared metadata and field payloads.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/vtk_io.h.
Definition at line 153 of file vtk_io.c.
| PetscErrorCode PrepareOutputCoordinates | ( | UserCtx * | user, |
| PetscScalar ** | out_coords, | ||
| PetscInt * | out_nx, | ||
| PetscInt * | out_ny, | ||
| PetscInt * | out_nz, | ||
| PetscInt * | out_npoints | ||
| ) |
Creates a C array of coordinates corresponding to a subsampled (legacy-style) grid.
This function gathers the full, distributed grid coordinates onto rank 0. On rank 0, it then allocates a new, smaller C array and copies only the coordinates for the nodes within the range [0..IM-2, 0..JM-2, 0..KM-2]. This produces a contiguous array of points for a grid of size (IM-1)x(JM-1)x(KM-1), matching the legacy output. The output arrays are only allocated and valid on rank 0.
| [in] | user | The UserCtx containing the grid information (DM, IM/JM/KM). |
| [out] | out_coords | On rank 0, a pointer to the newly allocated C array for coordinate data. NULL on other ranks. |
| [out] | out_nx | The number of points in the x-dimension for the new grid (IM-1). |
| [out] | out_ny | The number of points in the y-dimension for the new grid (JM-1). |
| [out] | out_nz | The number of points in the z-dimension for the new grid (KM-1). |
| [out] | out_npoints | The total number of points in the new grid. |
Creates a C array of coordinates corresponding to a subsampled (legacy-style) grid.
Local to this translation unit.
Definition at line 245 of file vtk_io.c.
| PetscErrorCode PrepareOutputEulerianFieldData | ( | UserCtx * | user, |
| Vec | field_vec, | ||
| PetscInt | num_components, | ||
| PetscScalar ** | out_data | ||
| ) |
Creates a C array of field data corresponding to a subsampled (legacy-style) grid.
This function gathers a full, distributed PETSc vector to rank 0. On rank 0, it then allocates a new, smaller C array and copies only the data components for nodes within the range [0..IM-2, 0..JM-2, 0..KM-2]. This produces a contiguous data array that perfectly matches the point ordering of the subsampled coordinates. The output array is only allocated and valid on rank 0.
| [in] | user | The UserCtx for grid information. |
| [in] | field_vec | The full-sized PETSc vector containing the field data (e.g., user->P_nodal). |
| [in] | num_components | The number of components for this field (1 for scalar, 3 for vector). |
| [out] | out_data | On rank 0, a pointer to the newly allocated C array for the field data. NULL on other ranks. |
Creates a C array of field data corresponding to a subsampled (legacy-style) grid.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/vtk_io.h.
Definition at line 313 of file vtk_io.c.
| PetscErrorCode PrepareOutputParticleData | ( | UserCtx * | user, |
| PostProcessParams * | pps, | ||
| VTKMetaData * | meta, | ||
| PetscInt * | p_n_total | ||
| ) |
Gathers, subsamples, and prepares all particle data for VTK output.
This function is a COLLECTIVE operation. All ranks must enter it. The heavy lifting (memory allocation, subsampling) is performed only on rank 0.
| [in] | user | The UserCtx containing the DMSwarm. |
| [in] | pps | The PostProcessParams struct for configuration. |
| [out] | meta | A pointer to the VTKMetaData struct to be populated (on rank 0). |
| [out] | p_n_total | On rank 0, the total number of particles before subsampling. |
Gathers, subsamples, and prepares all particle data for VTK output.
Local to this translation unit.
Definition at line 422 of file vtk_io.c.