My Project
programmer's documentation
|
#include "cs_defs.h"
#include <limits.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <float.h>
#include <assert.h>
#include "bft_printf.h"
#include "bft_error.h"
#include "bft_mem.h"
#include "cs_base.h"
#include "cs_math.h"
#include "cs_boundary_zone.h"
#include "cs_volume_zone.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_thermal_model.h"
#include "cs_parameters.h"
#include "cs_physical_model.h"
#include "cs_physical_constants.h"
#include "cs_prototypes.h"
#include "cs_time_step.h"
#include "cs_field.h"
#include "cs_field_pointer.h"
#include "cs_random.h"
#include "cs_lagr.h"
#include "cs_lagr_tracking.h"
#include "cs_lagr_new.h"
#include "cs_lagr_precipitation_model.h"
#include "cs_lagr_prototypes.h"
#include "cs_lagr_injection.h"
Functions | |
static cs_lnum_t | _segment_binary_search (cs_lnum_t n, double x, const double a[]) |
Binary search for a given local id in a given array of ordered values. More... | |
static cs_lnum_t | _distribute_particles (cs_gnum_t n_g_particles, cs_lnum_t n_elts, const cs_lnum_t elt_id[], const cs_real_t elt_weight[], const cs_real_t *elt_profile, cs_lnum_t elt_particle_idx[]) |
Distribute new particles in a given region. More... | |
static void | _injection_check (const cs_lagr_injection_set_t *zis) |
Check injection parameters are valid. More... | |
static cs_lnum_t * | _get_particle_face_ids (cs_lnum_t n_faces, const cs_lnum_t face_ids[], const cs_lnum_t face_particle_idx[]) |
Build particle injection face ids array for a given boundary zone and set. More... | |
static void | _init_particles (cs_lagr_particle_set_t *p_set, const cs_lagr_injection_set_t *zis, int time_id, cs_lnum_t n_elts, const cs_lnum_t *face_ids, const cs_lnum_t elt_particle_idx[]) |
Initialize particle values. More... | |
static void | _check_particles (cs_lagr_particle_set_t *p_set, const cs_lagr_injection_set_t *zis, cs_lnum_t n_elts, const cs_lnum_t elt_particle_idx[]) |
Check injected particle values. More... | |
void | cs_lagr_injection (int time_id, const int itypfb[], cs_real_t vislen[]) |
Inject particles in the computational domain. More... | |
|
static |
Check injected particle values.
[in,out] | p_set | particle set |
[in] | zis | injection data for this zone and set |
[in] | n_elts | number of elements in zone |
[in] | elt_particle_idx | starting id of new particles for a given element (size: n_elts+1) |
|
static |
Distribute new particles in a given region.
[in] | n_g_particles | global number of particles to inject |
[in] | n_elts | number of elements in region |
[in] | elt_id | element ids (or NULL) |
[in] | elt_weight | parent element weights (i.e. all local surfaces or volumes) |
[in] | elt_profile | optional profile values for elements (or NULL) |
[out] | elt_particle_idx | start index of added particles for each element (size: n_elts + 1) |
|
static |
Build particle injection face ids array for a given boundary zone and set.
The caller is responsible for freeing the returned array.
[in] | n_faces | number of elements in zone |
[in] | face_ids | matching face ids |
[in] | face_particle_idx | starting id of new particles for a given face (size: n_faces+1) |
|
static |
Initialize particle values.
[in,out] | p_set | particle set |
[in] | zis | injection data this zone and set |
[in] | time_id | time step indicator for fields 0: use fields at current time step 1: use fields at previous time step |
[in] | n_elts | number of elements in zone |
[in] | face_ids | matching face ids if zone is a boundary |
[in] | elt_particle_idx | starting id of new particles for a given element (size: n_elts+1) |
|
static |
Check injection parameters are valid.
[in] | zis | pointer to injection data for a given zone and set |
Binary search for a given local id in a given array of ordered values.
We assume the id is present in the array.
[in] | n | number of values |
[in] | x | value to locate |
[in] | a | array of ordered values (size n) |
void cs_lagr_injection | ( | int | time_id, |
const int | itypfb[], | ||
cs_real_t | vislen[] | ||
) |
Inject particles in the computational domain.
[in] | time_id | time step indicator for fields 0: use fields at current time step 1: use fields at previous time step |
[in] | itypfb | boundary face types |