My Project
programmer's documentation
Functions
cs_lagr_event.c File Reference
#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 "fvm_periodicity.h"
#include "cs_base.h"
#include "cs_math.h"
#include "cs_mesh_quantities.h"
#include "cs_order.h"
#include "cs_parall.h"
#include "cs_timer_stats.h"
#include "cs_lagr.h"
#include "cs_lagr_particle.h"
#include "cs_lagr_event.h"
Include dependency graph for cs_lagr_event.c:

Functions

void cs_lagr_event_initialize (void)
 Define particle map based on defined options. More...
 
void cs_lagr_event_finalize (void)
 Destroy main particle set and map if they exist. More...
 
const cs_lagr_event_attribute_map_tcs_lagr_event_get_attr_map (void)
 Return const pointer to the main particle event attribute map structure. More...
 
const char * cs_lagr_event_get_attr_name (cs_lagr_event_attribute_t attr)
 Return name associated with a given attribute. More...
 
cs_lagr_event_set_tcs_lagr_event_set_create (void)
 
void cs_lagr_event_set_destroy (cs_lagr_event_set_t **events)
 
void cs_lagr_event_get_attr_info (const cs_lagr_event_set_t *events, cs_lagr_event_attribute_t attr, size_t *extents, size_t *size, ptrdiff_t *displ, cs_datatype_t *datatype, int *count)
 Get data extents for a given particle event attribute. More...
 
void cs_lagr_event_attr_in_range (int attr)
 Check if an event attribute is in a valid range. More...
 
void cs_lagr_event_set_resize (cs_lagr_event_set_t *event_set, cs_lnum_t min_size)
 
void cs_lagr_event_set_dump (const cs_lagr_event_set_t *events)
 Dump a cs_lagr_event_set_t structure. More...
 
void cs_lagr_event_init_from_particle (cs_lagr_event_set_t *events, cs_lagr_particle_set_t *particles, cs_lnum_t event_id, cs_lnum_t particle_id)
 
cs_lagr_event_set_tcs_lagr_event_set_boundary_interaction (void)
 

Detailed Description

Particle event management.

Particle events allow keeping track of particle events suh as boundary interactions using a structure and API similar to that used for particles.

Particles events could actually be stored as particle data, given the necessary additional attributes defined here (i.e. using a different attribute map), and could be refactored in the future based on feedback.

As of now, it was chosen to use an independent structure, so as to avoid confusion regarding the more restricted uses and (temporary) lifetime of particle events, which should need to be maintained only as a buffer mechanism for event-based statistics.

Function Documentation

◆ cs_lagr_event_attr_in_range()

void cs_lagr_event_attr_in_range ( int  attr)

Check if an event attribute is in a valid range.

If this is not the case, a fatal error is provoked.

Parameters
[in]attrevent attribute

◆ cs_lagr_event_finalize()

void cs_lagr_event_finalize ( void  )

Destroy main particle set and map if they exist.

Destroy event set map if it exists.

◆ cs_lagr_event_get_attr_info()

void cs_lagr_event_get_attr_info ( const cs_lagr_event_set_t events,
cs_lagr_event_attribute_t  attr,
size_t *  extents,
size_t *  size,
ptrdiff_t *  displ,
cs_datatype_t datatype,
int *  count 
)

Get data extents for a given particle event attribute.

Get data extents for a given event attribute.

For attributes not currently present, the displacement and data size should be -1 and 0 respectively.

Parameters
[in]eventsassociated event set
[in]attrevent attribute
[out]extentssize (in bytes) of event structure, or NULL
[out]sizesize (in bytes) of attribute in event structure, or NULL
[out]displdisplacement (in bytes) in event structure, or NULL
[out]datatypedatatype of associated attribute, or NULL
[out]countnumber of type values associated with attribute, or NULL

◆ cs_lagr_event_get_attr_map()

const cs_lagr_event_attribute_map_t* cs_lagr_event_get_attr_map ( void  )

Return const pointer to the main particle event attribute map structure.

Return const pointer to the main event attribute map structure.

Returns
pointer to current particle event attrbute map, or NULL

◆ cs_lagr_event_get_attr_name()

const char* cs_lagr_event_get_attr_name ( cs_lagr_event_attribute_t  attr)

Return name associated with a given attribute.

Parameters
[in]attrevent attribute

◆ cs_lagr_event_init_from_particle()

void cs_lagr_event_init_from_particle ( cs_lagr_event_set_t events,
cs_lagr_particle_set_t particles,
cs_lnum_t  event_id,
cs_lnum_t  particle_id 
)

◆ cs_lagr_event_initialize()

void cs_lagr_event_initialize ( void  )

Define particle map based on defined options.

Define event map based on defined options.

◆ cs_lagr_event_set_boundary_interaction()

cs_lagr_event_set_t* cs_lagr_event_set_boundary_interaction ( void  )

Return a cs_lagr_event_set_t structure for particle/boundary interactions.

The event set is created if not present yet.

This event set is automatically freed and destroyed at the end of the computation.

Returns
pointer to event set

◆ cs_lagr_event_set_create()

cs_lagr_event_set_t* cs_lagr_event_set_create ( void  )

Create a cs_lagr_event_set_t structure.

Returns
pointer to event set

◆ cs_lagr_event_set_destroy()

void cs_lagr_event_set_destroy ( cs_lagr_event_set_t **  events)

Destroy a cs_lagr_event_set_t structure.

Parameters
[in,out]pointerto pointer to event set to destroy

◆ cs_lagr_event_set_dump()

void cs_lagr_event_set_dump ( const cs_lagr_event_set_t events)

Dump a cs_lagr_event_set_t structure.

Parameters
[in]eventscs_lagr_event_set_t structure to dump

◆ cs_lagr_event_set_resize()

void cs_lagr_event_set_resize ( cs_lagr_event_set_t event_set,
cs_lnum_t  min_size 
)