My Project
programmer's documentation
Data Structures | Macros | Enumerations | Functions
cs_lagr_event.h File Reference
#include "cs_defs.h"
#include "cs_lagr_particle.h"
#include "assert.h"
Include dependency graph for cs_lagr_event.h:

Go to the source code of this file.

Data Structures

struct  cs_lagr_event_attribute_map_t
 
struct  cs_lagr_event_set_t
 

Macros

#define CS_EVENT_INFLOW   (1 << 0)
 
#define CS_EVENT_OUTFLOW   (1 << 1)
 
#define CS_EVENT_REBOUND   (1 << 2)
 
#define CS_EVENT_DEPOSITION   (1 << 3)
 
#define CS_EVENT_RESUSPENSION   (1 << 4)
 
#define CS_EVENT_ROLL_OFF   (1 << 5)
 
#define CS_EVENT_ROLL_ON   (1 << 6)
 
#define CS_EVENT_FOULING   (1 << 7)
 

Enumerations

enum  cs_lagr_event_attribute_t {
  CS_LAGR_E_FLAG = CS_LAGR_N_ATTRIBUTES, CS_LAGR_E_CELL_ID, CS_LAGR_E_FACE_ID, CS_LAGR_E_VELOCITY,
  CS_LAGR_N_E_ATTRIBUTES
}
 

Functions

void cs_lagr_event_initialize (void)
 Define event map based on defined options. More...
 
void cs_lagr_event_finalize (void)
 Destroy event set map if it exists. More...
 
const cs_lagr_event_attribute_map_tcs_lagr_event_get_attr_map (void)
 Return const pointer to the main 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 event attribute. More...
 
void cs_lagr_event_attr_in_range (int attr)
 Check if an event attribute is in a valid range. More...
 
static void * cs_lagr_events_attr (cs_lagr_event_set_t *event_set, cs_lnum_t event_id, cs_lagr_event_attribute_t attr)
 Get pointer to a current attribute of a given event in a set. More...
 
static const void * cs_lagr_events_attr_const (const cs_lagr_event_set_t *event_set, cs_lnum_t event_id, cs_lagr_event_attribute_t attr)
 Get const pointer to current attribute data of a given event in a set. More...
 
static cs_lnum_t cs_lagr_events_get_lnum (const cs_lagr_event_set_t *event_set, cs_lnum_t event_id, cs_lagr_event_attribute_t attr)
 Get attribute value of type cs_lnum_t of a given event in a set. More...
 
static void cs_lagr_events_set_lnum (cs_lagr_event_set_t *event_set, cs_lnum_t event_id, cs_lagr_event_attribute_t attr, cs_lnum_t value)
 Set attribute value of type cs_lnum_t of a given event in a set. More...
 
static cs_real_t cs_lagr_events_get_real (const cs_lagr_event_set_t *event_set, cs_lnum_t event_id, cs_lagr_event_attribute_t attr)
 Get attribute value of type cs_real_t of a given event in a set. More...
 
static void cs_lagr_events_set_real (cs_lagr_event_set_t *event_set, cs_lnum_t event_id, cs_lagr_event_attribute_t attr, cs_real_t value)
 Set attribute value of type cs_real_t of a given event in a set. 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)
 

Macro Definition Documentation

◆ CS_EVENT_DEPOSITION

#define CS_EVENT_DEPOSITION   (1 << 3)

deposistion event

◆ CS_EVENT_FOULING

#define CS_EVENT_FOULING   (1 << 7)

fouling

◆ CS_EVENT_INFLOW

#define CS_EVENT_INFLOW   (1 << 0)

Flags specifying general event attributes

inflow event

◆ CS_EVENT_OUTFLOW

#define CS_EVENT_OUTFLOW   (1 << 1)

outflow event

◆ CS_EVENT_REBOUND

#define CS_EVENT_REBOUND   (1 << 2)

rebound on wall

◆ CS_EVENT_RESUSPENSION

#define CS_EVENT_RESUSPENSION   (1 << 4)

resuspension event

◆ CS_EVENT_ROLL_OFF

#define CS_EVENT_ROLL_OFF   (1 << 5)

roll off

◆ CS_EVENT_ROLL_ON

#define CS_EVENT_ROLL_ON   (1 << 6)

roll on

Enumeration Type Documentation

◆ cs_lagr_event_attribute_t

Prefedined event attributes

Enumerator
CS_LAGR_E_FLAG 

local flag

CS_LAGR_E_CELL_ID 

local cell id

CS_LAGR_E_FACE_ID 

local face id (-1 if not on boundary)

CS_LAGR_E_VELOCITY 

velocity following event

CS_LAGR_N_E_ATTRIBUTES 

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 event set map if it exists.

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 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

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 event attribute map structure.

Returns
pointer to current event attribute map, or NULL

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 event map based on defined options.

This function should only be called after cs_lagr_attr_initialize, as it may use elements from the main particle attributes map.

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_t structure to dump
[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 
)

◆ cs_lagr_events_attr()

static void* cs_lagr_events_attr ( cs_lagr_event_set_t event_set,
cs_lnum_t  event_id,
cs_lagr_event_attribute_t  attr 
)
inlinestatic

Get pointer to a current attribute of a given event in a set.

Parameters
[in]event_setpointer to event set
[in]event_idevent id
[in]attrrequested attribute id
Returns
pointer to current attribute data

◆ cs_lagr_events_attr_const()

static const void* cs_lagr_events_attr_const ( const cs_lagr_event_set_t event_set,
cs_lnum_t  event_id,
cs_lagr_event_attribute_t  attr 
)
inlinestatic

Get const pointer to current attribute data of a given event in a set.

Parameters
[in]event_setpointer to event set
[in]event_idevent id
[in]attrrequested attribute id
Returns
pointer to current attribute data

◆ cs_lagr_events_get_lnum()

static cs_lnum_t cs_lagr_events_get_lnum ( const cs_lagr_event_set_t event_set,
cs_lnum_t  event_id,
cs_lagr_event_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_lnum_t of a given event in a set.

Parameters
[in]event_setpointer to event set
[in]event_idevent id
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_events_get_real()

static cs_real_t cs_lagr_events_get_real ( const cs_lagr_event_set_t event_set,
cs_lnum_t  event_id,
cs_lagr_event_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_real_t of a given event in a set.

Parameters
[in]event_setpointer to event set
[in]event_idevent id
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_events_set_lnum()

static void cs_lagr_events_set_lnum ( cs_lagr_event_set_t event_set,
cs_lnum_t  event_id,
cs_lagr_event_attribute_t  attr,
cs_lnum_t  value 
)
inlinestatic

Set attribute value of type cs_lnum_t of a given event in a set.

Parameters
[in,out]event_setpointer to event set
[in]event_idevent id
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_events_set_real()

static void cs_lagr_events_set_real ( cs_lagr_event_set_t event_set,
cs_lnum_t  event_id,
cs_lagr_event_attribute_t  attr,
cs_real_t  value 
)
inlinestatic

Set attribute value of type cs_real_t of a given event in a set.

Parameters
[in,out]event_setpointer to event set
[in]event_idevent id
[in]attrrequested attribute id
[in]valuevalue to assign