7.0
general documentation
cs_boundary_zone.h File Reference
#include "cs_base.h"
#include "cs_mesh_location.h"
#include "cs_defs.h"
#include "cs_zone.h"
+ Include dependency graph for cs_boundary_zone.h:

Go to the source code of this file.

Macros

#define CS_BOUNDARY_ZONE_WALL   (1 << 0)
 
#define CS_BOUNDARY_ZONE_PRIVATE   (1 << 1)
 

Functions

void cs_boundary_zone_initialize (void)
 Initialize boundary zone structures. More...
 
void cs_boundary_zone_finalize (void)
 Free all boundary zone structures. More...
 
int cs_boundary_zone_n_zones (void)
 Return number of boundary zones defined. More...
 
int cs_boundary_zone_n_zones_time_varying (void)
 Return number of boundary zones which may vary in time. More...
 
void cs_boundary_zone_build_private (int id)
 Update association of a given private boundary zone with a mesh. More...
 
void cs_boundary_zone_build_all (bool mesh_modified)
 Update association of boundary zones with a mesh. More...
 
int cs_boundary_zone_define (const char *name, const char *criteria, int type_flag)
 Define a new boundary zone using a selection criteria string. More...
 
int cs_boundary_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_boundary_zone_by_id (int id)
 Return a pointer to a boundary zone based on its id. More...
 
const cs_zone_tcs_boundary_zone_by_name (const char *name)
 Return a pointer to a boundary zone based on its name if present. More...
 
const cs_zone_tcs_boundary_zone_by_name_try (const char *name)
 Return a pointer to a boundary zone based on its name if present. More...
 
void cs_boundary_zone_set_type (int id, int type_flag)
 Set type flag for a given boundary zone. More...
 
void cs_boundary_zone_set_time_varying (int id, bool time_varying)
 Set time varying behavior for a given boundary zone. More...
 
void cs_boundary_zone_set_overlay (int id, bool allow_overlay)
 Set overlay behavior for a given boundary zone. More...
 
const int * cs_boundary_zone_face_zone_id (void)
 Return pointer to zone id associated with each boundary face. More...
 
void cs_boundary_zone_log_info (const cs_zone_t *z)
 Print info relative to a given boundary zone to log file. More...
 
void cs_boundary_zone_log_setup (void)
 Log setup information relative to defined boundary zones. More...
 
int cs_boundary_zone_n_type_zones (int type_flag)
 Return number of boundary zones associated with a given zone flag. More...
 
int * cs_boundary_zone_face_class_id (void)
 Get pointer to optional boundary face class ids. More...
 
const int * cs_boundary_zone_face_class_or_zone_id (void)
 Get read pointer to optional boundary face class or zone ids. More...
 
void cs_boundary_zone_update_face_class_id (void)
 Update boundary face output class ids if present. More...
 
int cs_boundary_zone_max_class_or_zone_id (void)
 Return the maximum defined face class or zone id. More...
 
void cs_boundary_zone_print_info (void)
 Print boundary zones information to listing file. More...
 

Function Documentation

◆ cs_boundary_zone_build_all()

void cs_boundary_zone_build_all ( bool  mesh_modified)

Update association of boundary zones with a mesh.

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

Parameters
[in]mesh_modifiedindicate if mesh has been modified

◆ cs_boundary_zone_build_private()

void cs_boundary_zone_build_private ( int  id)

Update association of a given private boundary zone with a mesh.

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

Parameters
[in]idzone id

◆ cs_boundary_zone_by_id()

const cs_zone_t* cs_boundary_zone_by_id ( int  id)

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

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

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

◆ cs_boundary_zone_by_name()

const cs_zone_t* cs_boundary_zone_by_name ( const char *  name)

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

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

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

◆ cs_boundary_zone_by_name_try()

const cs_zone_t* cs_boundary_zone_by_name_try ( const char *  name)

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

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

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

◆ cs_boundary_zone_define()

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

Define a new boundary 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 boundary zone

◆ cs_boundary_zone_define_by_func()

int cs_boundary_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_boundary_zone_face_class_id()

int* cs_boundary_zone_face_class_id ( void  )

Get pointer to optional boundary face class ids.

For each boundary face, a specific output (logging and postprocessing) class id may be assigned. This allows realizing logging, postprocessing, or otherwise extracting data based on this class.

Using this function at a given point indicates that user-defined class ids will be used. The face class ids are initially equal to the face zone ids, but may be modified by the user.

In the presence of a time-varying mesh or boundary zones, the face class ids will be reset to the zone ids, so it may be necessary to update the user definitions.

The class id values are arbitrarily chosen by the user, but must be positive integers; numbers do not need to be contiguous, but very high numbers may also lead to higher memory consumption.

Returns
pointer to array of boundary face output zone ids;

◆ cs_boundary_zone_face_class_or_zone_id()

const int* cs_boundary_zone_face_class_or_zone_id ( void  )

Get read pointer to optional boundary face class or zone ids.

If no face classes have been defined by cs_boundary_zone_face_class_id the boundary face zone id is returned instead.

Returns
pointer to array of boundary face output zone ids;

◆ cs_boundary_zone_face_zone_id()

const int* cs_boundary_zone_face_zone_id ( void  )

Return pointer to zone id associated with each boundary face.

In case of overlayed zones, the highest zone id associated with a given face is given. Private (automatically defined) zones are excluded from this definition.

◆ cs_boundary_zone_finalize()

void cs_boundary_zone_finalize ( void  )

Free all boundary zone structures.

◆ cs_boundary_zone_initialize()

void cs_boundary_zone_initialize ( void  )

Initialize boundary zone structures.

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

◆ cs_boundary_zone_log_info()

void cs_boundary_zone_log_info ( const cs_zone_t z)

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

Parameters
[in]zpointer to boundary zone structure

◆ cs_boundary_zone_log_setup()

void cs_boundary_zone_log_setup ( void  )

Log setup information relative to defined boundary zones.

◆ cs_boundary_zone_max_class_or_zone_id()

int cs_boundary_zone_max_class_or_zone_id ( void  )

Return the maximum defined face class or zone id.

Returns
maximum face class or zone id;

This value is valid only if cs_boundary_zone_update_face_class_id

Returns
maximum face class or zone id;

◆ cs_boundary_zone_n_type_zones()

int cs_boundary_zone_n_type_zones ( int  type_flag)

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

Private (automatic) zones are excluded from this count.

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

◆ cs_boundary_zone_n_zones()

int cs_boundary_zone_n_zones ( void  )

Return number of boundary zones defined.

◆ cs_boundary_zone_n_zones_time_varying()

int cs_boundary_zone_n_zones_time_varying ( void  )

Return number of boundary zones which may vary in time.

Returns
number of zones which may vary in time

◆ cs_boundary_zone_print_info()

void cs_boundary_zone_print_info ( void  )

Print boundary zones information to listing file.

◆ cs_boundary_zone_set_overlay()

void cs_boundary_zone_set_overlay ( int  id,
bool  allow_overlay 
)

Set overlay behavior for a given boundary zone.

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

◆ cs_boundary_zone_set_time_varying()

void cs_boundary_zone_set_time_varying ( int  id,
bool  time_varying 
)

Set time varying behavior for a given boundary zone.

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

◆ cs_boundary_zone_set_type()

void cs_boundary_zone_set_type ( int  id,
int  type_flag 
)

Set type flag for a given boundary zone.

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

◆ cs_boundary_zone_update_face_class_id()

void cs_boundary_zone_update_face_class_id ( void  )

Update boundary face output class ids if present.

Face class ids lower than 0 are replaced by the matching face zone id.