8.0
general documentation
cs_xdef.c File Reference

Functions to handle extended definitions of quantities thanks to the cs_xdef_t structures. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "bft_mem.h"
#include "cs_array.h"
#include "cs_field.h"
#include "cs_flag.h"
#include "cs_log.h"
#include "cs_mesh_location.h"
#include "cs_xdef.h"
+ Include dependency graph for cs_xdef.c:

Macros

#define CS_XDEF_DBG   0
 

Functions

cs_xdef_tcs_xdef_volume_create (cs_xdef_type_t type, int dim, int z_id, cs_flag_t state, cs_flag_t meta, void *context)
 Allocate and initialize a new cs_xdef_t structure based on volumic elements. More...
 
cs_xdef_tcs_xdef_boundary_create (cs_xdef_type_t type, int dim, int z_id, cs_flag_t state, cs_flag_t meta, void *context)
 Allocate and initialize a new cs_xdef_t structure based on boundary elements. More...
 
cs_xdef_tcs_xdef_timestep_create (cs_xdef_type_t type, cs_flag_t state, cs_flag_t meta, void *context)
 Allocate and initialize a new cs_xdef_t structure for setting the time step. More...
 
cs_xdef_tcs_xdef_free (cs_xdef_t *d)
 Free a cs_xdef_t structure. More...
 
cs_xdef_tcs_xdef_copy (cs_xdef_t *src)
 copy a cs_xdef_t structure More...
 
void cs_xdef_set_input_context (cs_xdef_t *d, void *input)
 In the case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs), this function allows one to set a more or less complex input data structure. This call should be done before the first evaluation of the associated cs_xdef_t structure. More...
 
void cs_xdef_set_free_input_function (cs_xdef_t *d, cs_xdef_free_input_t *free_input)
 In case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs). One can set a function to free a complex input data structure (please refer to cs_xdef_free_input_t) for more details. More...
 
void cs_xdef_set_quadrature (cs_xdef_t *d, cs_quadrature_type_t qtype)
 Set the type of quadrature to use for evaluating the given description. More...
 
cs_quadrature_type_t cs_xdef_get_quadrature (cs_xdef_t *d)
 Get the type of quadrature to use for evaluating the given description. More...
 
cs_xdef_type_t cs_xdef_get_type (const cs_xdef_t *d)
 Retrieve the flag dedicated to the state. More...
 
cs_flag_t cs_xdef_get_state_flag (const cs_xdef_t *d)
 Retrieve the flag dedicated to the state. More...
 
void cs_xdef_log_setup (const char *prefix, const cs_xdef_t *d)
 Output the settings related to a cs_xdef_t structure in the setup logging file. More...
 
void cs_xdef_log (cs_log_t log_type, const char *prefix, const cs_xdef_t *d)
 Output the settings related to a cs_xdef_t structure. More...
 

Variables

static const char * _xdef_type_name []
 

Detailed Description

Functions to handle extended definitions of quantities thanks to the cs_xdef_t structures.

Macro Definition Documentation

◆ CS_XDEF_DBG

#define CS_XDEF_DBG   0

Function Documentation

◆ cs_xdef_boundary_create()

cs_xdef_t* cs_xdef_boundary_create ( cs_xdef_type_t  type,
int  dim,
int  z_id,
cs_flag_t  state,
cs_flag_t  meta,
void *  context 
)

Allocate and initialize a new cs_xdef_t structure based on boundary elements.

Parameters
[in]typetype of definition
[in]dimdimension of the values to define
[in]z_idvolume zone id
[in]stateflag to know if this uniform, cellwise, steady...
[in]metametadata associated to this description
[in]contextpointer to a structure
Returns
a pointer to the new cs_xdef_t structure

◆ cs_xdef_copy()

cs_xdef_t* cs_xdef_copy ( cs_xdef_t src)

copy a cs_xdef_t structure

Parameters
[in]srcpointer to a cs_xdef_t structure to copy
Returns
a pointer to a new allocated cs_xdef_t structure

◆ cs_xdef_free()

cs_xdef_t* cs_xdef_free ( cs_xdef_t d)

Free a cs_xdef_t structure.

Parameters
[in,out]dpointer to a cs_xdef_t structure
Returns
NULL

◆ cs_xdef_get_quadrature()

cs_quadrature_type_t cs_xdef_get_quadrature ( cs_xdef_t d)

Get the type of quadrature to use for evaluating the given description.

Parameters
[in]dpointer to a cs_xdef_t structure
Returns
the type of quadrature

◆ cs_xdef_get_state_flag()

cs_flag_t cs_xdef_get_state_flag ( const cs_xdef_t d)

Retrieve the flag dedicated to the state.

Parameters
[in]dpointer to a cs_xdef_t structure
Returns
the value of the flag

◆ cs_xdef_get_type()

cs_xdef_type_t cs_xdef_get_type ( const cs_xdef_t d)

Retrieve the flag dedicated to the state.

Parameters
[in]dpointer to a cs_xdef_t structure
Returns
the value of the flag

◆ cs_xdef_log()

void cs_xdef_log ( cs_log_t  log_type,
const char *  prefix,
const cs_xdef_t d 
)

Output the settings related to a cs_xdef_t structure.

Parameters
[in]log_typerelated log file to consider
[in]prefixoptional string
[in]dpointer to a cs_xdef_t structure

◆ cs_xdef_log_setup()

void cs_xdef_log_setup ( const char *  prefix,
const cs_xdef_t d 
)

Output the settings related to a cs_xdef_t structure in the setup logging file.

Parameters
[in]prefixoptional string
[in]dpointer to a cs_xdef_t structure

◆ cs_xdef_set_free_input_function()

void cs_xdef_set_free_input_function ( cs_xdef_t d,
cs_xdef_free_input_t free_input 
)

In case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs). One can set a function to free a complex input data structure (please refer to cs_xdef_free_input_t) for more details.

Parameters
[in,out]dpointer to a cs_xdef_t structure
[in]free_inputpointer to a function which free the input structure

◆ cs_xdef_set_input_context()

void cs_xdef_set_input_context ( cs_xdef_t d,
void *  input 
)

In the case of a definition by an analytic function, a time function or a function relying on degrees of freedom (DoFs), this function allows one to set a more or less complex input data structure. This call should be done before the first evaluation of the associated cs_xdef_t structure.

Parameters
[in,out]dpointer to a cs_xdef_t structure
[in]inputpointer to an input structure

◆ cs_xdef_set_quadrature()

void cs_xdef_set_quadrature ( cs_xdef_t d,
cs_quadrature_type_t  qtype 
)

Set the type of quadrature to use for evaluating the given description.

Parameters
[in,out]dpointer to a cs_xdef_t structure
[in]qtypetype of quadrature

◆ cs_xdef_timestep_create()

cs_xdef_t* cs_xdef_timestep_create ( cs_xdef_type_t  type,
cs_flag_t  state,
cs_flag_t  meta,
void *  context 
)

Allocate and initialize a new cs_xdef_t structure for setting the time step.

Parameters
[in]typetype of definition
[in]stateflag to know if this uniform, cellwise, steady...
[in]metametadata associated to this description
[in]contextpointer to a structure storing the parameters (cast on-the-fly according to the type of definition)
Returns
a pointer to the new cs_xdef_t structure

◆ cs_xdef_volume_create()

cs_xdef_t* cs_xdef_volume_create ( cs_xdef_type_t  type,
int  dim,
int  z_id,
cs_flag_t  state,
cs_flag_t  meta,
void *  context 
)

Allocate and initialize a new cs_xdef_t structure based on volumic elements.

Parameters
[in]typetype of definition
[in]dimdimension of the values to define
[in]z_idvolume zone id
[in]stateflag to know if this uniform, cellwise, steady...
[in]metametadata associated to this description
[in]contextpointer to a structure
Returns
a pointer to the new cs_xdef_t structure

Variable Documentation

◆ _xdef_type_name

const char* _xdef_type_name[]
static
Initial value:
= {"CS_XDEF_BY_ANALYTIC_FUNCTION",
"CS_XDEF_BY_ARRAY",
"CS_XDEF_BY_DOF_FUNCTION",
"CS_XDEF_BY_FIELD",
"CS_XDEF_BY_FUNCTION",
"CS_XDEF_BY_QOV",
"CS_XDEF_BY_SUB_DEFINITIONS",
"CS_XDEF_BY_TIME_FUNCTION",
"CS_XDEF_BY_VALUE",
"out of range"}