7.0
general documentation
cs_volume_zone.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mpi.h>
#include <ple_locator.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_flag_check.h"
#include "cs_log.h"
#include "cs_map.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
#include "cs_parall.h"
#include "cs_parameters.h"
#include "cs_volume_zone.h"
+ Include dependency graph for cs_volume_zone.c:

Functions

void cs_volume_zone_initialize (void)
 Initialize volume zone structures. More...
 
void cs_volume_zone_finalize (void)
 Free all volume zone structures. More...
 
int cs_volume_zone_n_zones (void)
 Return number of volume zones defined. More...
 
int cs_volume_zone_n_zones_time_varying (void)
 Return number of volume zones which may vary in time. More...
 
void cs_volume_zone_build_all (bool mesh_modified)
 Update association of volume zones with a mesh. More...
 
int cs_volume_zone_define (const char *name, const char *criteria, int type_flag)
 Define a new volume zone using a selection criteria string. More...
 
int cs_volume_zone_define_by_func (const char *name, cs_mesh_location_select_t *func, void *input, int type_flag)
 Define a new mesh location with an associated selection function. More...
 
const cs_zone_tcs_volume_zone_by_id (int id)
 Return a pointer to a volume zone based on its id. More...
 
const cs_zone_tcs_volume_zone_by_name (const char *name)
 Return a pointer to a volume zone based on its name if present. More...
 
const cs_zone_tcs_volume_zone_by_name_try (const char *name)
 Return a pointer to a volume zone based on its name if present. More...
 
void cs_volume_zone_set_type (int id, int type_flag)
 Set type flag for a given volume zone. More...
 
void cs_volume_zone_set_time_varying (int id, bool time_varying)
 Set time varying behavior for a given volume zone. More...
 
void cs_volume_zone_set_overlay (int id, bool allow_overlay)
 Set overlay behavior for a given volume zone. More...
 
const int * cs_volume_zone_cell_zone_id (void)
 Return pointer to zone id associated with each cell. More...
 
void cs_volume_zone_log_info (const cs_zone_t *z)
 Print info relative to a given volume zone to log file. More...
 
void cs_volume_zone_log_setup (void)
 Log setup information relative to defined volume zones. More...
 
int cs_volume_zone_n_type_zones (int type_flag)
 Return number of volume zones associated with a given zone flag. More...
 
cs_lnum_t cs_volume_zone_n_type_cells (int type_flag)
 Return number of volume zone cells associated with a given zone flag. More...
 
void cs_volume_zone_select_type_cells (int type_flag, cs_lnum_t cell_ids[])
 Select cells associated with volume zones of a given type. More...
 
void cs_volume_zone_tag_cell_type (int zone_type_flag, int tag_value, int tag[])
 Tag cells of a given zone type. More...
 
void cs_volume_zone_print_info (void)
 Print volume zones information to listing file. More...
 

Detailed Description

Volume zone handling.

Function Documentation

◆ cs_volume_zone_build_all()

void cs_volume_zone_build_all ( bool  mesh_modified)

Update association of volume zones with a mesh.

For time-varying zones, the associated mesh location is updated.

Parameters
[in]mesh_modifiedindicate if mesh has been modified

◆ cs_volume_zone_by_id()

const cs_zone_t* cs_volume_zone_by_id ( int  id)

Return a pointer to a volume zone based on its id.

This function requires that a volume zone of the given id is defined.

Parameters
[in]idzone id
Returns
pointer to the volume zone structure

◆ cs_volume_zone_by_name()

const cs_zone_t* cs_volume_zone_by_name ( const char *  name)

Return a pointer to a volume zone based on its name if present.

This function requires that a volume zone of the given name is defined.

Parameters
[in]namevolume zone name
Returns
pointer to (read-only) zone structure

◆ cs_volume_zone_by_name_try()

const cs_zone_t* cs_volume_zone_by_name_try ( const char *  name)

Return a pointer to a volume zone based on its name if present.

If no volume zone of the given name is defined, NULL is returned.

Parameters
[in]namevolume zone name
Returns
pointer to (read only) zone structure, or NULL

◆ cs_volume_zone_cell_zone_id()

const int* cs_volume_zone_cell_zone_id ( void  )

Return pointer to zone id associated with each cell.

In case of overlayed zones, the highest zone id associated with a given cell is given.

◆ cs_volume_zone_define()

int cs_volume_zone_define ( const char *  name,
const char *  criteria,
int  type_flag 
)

Define a new volume zone using a selection criteria string.

Parameters
[in]namename of location to define
[in]criteriaselection criteria for associated elements
[in]type_flagmask of zone category values
Returns
id of newly defined volume zone

◆ cs_volume_zone_define_by_func()

int cs_volume_zone_define_by_func ( const char *  name,
cs_mesh_location_select_t func,
void *  input,
int  type_flag 
)

Define a new mesh location with an associated selection function.

So as to define a subset of mesh entities of a given type, a pointer to a selection function may be given.

This requires more programming but allows finer control than selection criteria, as the function has access to the complete mesh structure.

Parameters
[in]namename of location to define
[in]funcpointer to selection function for associated elements
[in,out]inputpointer to optional (untyped) value or structure.
[in]type_flagmask of zone category values
Returns
id of newly defined created mesh location

◆ cs_volume_zone_finalize()

void cs_volume_zone_finalize ( void  )

Free all volume zone structures.

◆ cs_volume_zone_initialize()

void cs_volume_zone_initialize ( void  )

Initialize volume zone structures.

This defines a default volume zone. This is the first function of the volume zone handling functions which should be called, and it should only be called after cs_mesh_location_initialize.

◆ cs_volume_zone_log_info()

void cs_volume_zone_log_info ( const cs_zone_t z)

Print info relative to a given volume zone to log file.

Parameters
[in]zpointer to volume zone structure

◆ cs_volume_zone_log_setup()

void cs_volume_zone_log_setup ( void  )

Log setup information relative to defined volume zones.

◆ cs_volume_zone_n_type_cells()

cs_lnum_t cs_volume_zone_n_type_cells ( int  type_flag)

Return number of volume zone cells associated with a given zone flag.

Note that in the case of overlapping zones, a cell may be accounted for multiple times.

Parameters
[in]type_flagflag to compare to zone type
Returns
number of cells in zones matching the given type flag

◆ cs_volume_zone_n_type_zones()

int cs_volume_zone_n_type_zones ( int  type_flag)

Return number of volume zones associated with a given zone flag.

Parameters
[in]type_flagflag to compare to zone type
Returns
number of zones matching the given type flag

◆ cs_volume_zone_n_zones()

int cs_volume_zone_n_zones ( void  )

Return number of volume zones defined.

◆ cs_volume_zone_n_zones_time_varying()

int cs_volume_zone_n_zones_time_varying ( void  )

Return number of volume zones which may vary in time.

Returns
number of zones which may vary in time

◆ cs_volume_zone_print_info()

void cs_volume_zone_print_info ( void  )

Print volume zones information to listing file.

◆ cs_volume_zone_select_type_cells()

void cs_volume_zone_select_type_cells ( int  type_flag,
cs_lnum_t  cell_ids[] 
)

Select cells associated with volume zones of a given type.

Note that in the case of overlapping zones, a cell may be accounted for multiple times.

Parameters
[in]type_flagflag to compare to zone type
[out]cell_idsids of selected cells (size: given by cs_volume_zone_n_type_cells)

◆ cs_volume_zone_set_overlay()

void cs_volume_zone_set_overlay ( int  id,
bool  allow_overlay 
)

Set overlay behavior for a given volume zone.

Parameters
[in]idvolume zone id
[in]allow_overlaytrue if the zone may be overlayed by another

◆ cs_volume_zone_set_time_varying()

void cs_volume_zone_set_time_varying ( int  id,
bool  time_varying 
)

Set time varying behavior for a given volume zone.

Parameters
[in]idvolume zone id
[in]time_varyingtrue if the zone's definition varies in time

◆ cs_volume_zone_set_type()

void cs_volume_zone_set_type ( int  id,
int  type_flag 
)

Set type flag for a given volume zone.

Parameters
[in]idvolume zone id
[in]type_flagvolume zone type flag

◆ cs_volume_zone_tag_cell_type()

void cs_volume_zone_tag_cell_type ( int  zone_type_flag,
int  tag_value,
int  tag[] 
)

Tag cells of a given zone type.

The tag array should be initialized. The given tag_value is associted to cells of the given zone type using a logical "or", so multiple flag bits can be handled using the same array if necessary.

Parameters
[in]zone_type_flagzone types to tag
[in]tag_valuetag value to add to cells of matching zones
[in,out]tagtag value for each cell