programmer's documentation
Functions | Variables
cs_domain.c File Reference

Manage a computational domain within the CDO framework. More...

#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <locale.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_boundary_zone.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_mesh_location.h"
#include "cs_prototypes.h"
#include "cs_quadrature.h"
#include "cs_time_step.h"
#include "cs_domain.h"
Include dependency graph for cs_domain.c:

Functions

cs_domain_tcs_domain_create (void)
 Create and initialize by default a cs_domain_t structure. More...
 
void cs_domain_free (cs_domain_t **p_domain)
 Free a cs_domain_t structure. More...
 
void cs_domain_set_cdo_mode (cs_domain_t *domain, int mode)
 Set the global variable storing the mode of activation to apply to CDO/HHO schemes. More...
 
int cs_domain_get_cdo_mode (const cs_domain_t *domain)
 Get the mode of activation for the CDO/HHO schemes. More...
 
const char * cs_domain_get_boundary_name (cs_domain_boundary_type_t type)
 Get the name of the domain boundary condition This name is also used as a name for zone definition. More...
 
void cs_domain_set_default_boundary (cs_domain_t *domain, cs_domain_boundary_type_t type)
 Set the default boundary related to this domain. More...
 
void cs_domain_add_boundary (cs_domain_t *domain, cs_domain_boundary_type_t type, const char *zone_name)
 Add a boundary type defined on a mesh location. More...
 
void cs_domain_set_time_param (cs_domain_t *domain, int nt_max, double t_max)
 Set parameters for unsteady computations: the max number of time steps or the final physical time of the simulation. More...
 
void cs_domain_set_output_param (cs_domain_t *domain, int nt_list, int verbosity)
 Set auxiliary parameters related to the way output is done. More...
 
void cs_domain_def_time_step_by_function (cs_domain_t *domain, cs_timestep_func_t *func, void *func_input)
 Define the value of the time step thanks to a predefined function. More...
 
void cs_domain_def_time_step_by_value (cs_domain_t *domain, double dt)
 Define the value of the time step. More...
 
bool cs_domain_needs_iteration (cs_domain_t *domain)
 Check if one needs to continue iterations in time. More...
 
bool cs_domain_needs_log (const cs_domain_t *domain)
 Check if an ouput is requested according to the domain setting. More...
 
void cs_domain_define_current_time_step (cs_domain_t *domain)
 Set the current time step for this new time iteration. More...
 
void cs_domain_increment_time (cs_domain_t *domain)
 Update time step after one temporal iteration. More...
 
void cs_domain_cdo_log (const cs_domain_t *domain)
 Print a welcome message indicating which mode of CDO is activated. More...
 

Variables

cs_domain_tcs_glob_domain = NULL
 
static const char _err_empty_domain []
 
static double cs_domain_kahan_time_compensation = 0.0
 
static const char cs_domain_boundary_name [CS_DOMAIN_N_BOUNDARY_TYPES][CS_BASE_STRING_LEN]
 

Detailed Description

Manage a computational domain within the CDO framework.

Function Documentation

◆ cs_domain_add_boundary()

void cs_domain_add_boundary ( cs_domain_t domain,
cs_domain_boundary_type_t  type,
const char *  zone_name 
)

Add a boundary type defined on a mesh location.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]typetype of boundary to set
[in]zone_namename of the zone related to this boundary

◆ cs_domain_cdo_log()

void cs_domain_cdo_log ( const cs_domain_t domain)

Print a welcome message indicating which mode of CDO is activated.

Parameters
[in]domainpointer to a cs_domain_t structure

◆ cs_domain_create()

cs_domain_t* cs_domain_create ( void  )

Create and initialize by default a cs_domain_t structure.

Returns
a pointer to a cs_domain_t structure

◆ cs_domain_def_time_step_by_function()

void cs_domain_def_time_step_by_function ( cs_domain_t domain,
cs_timestep_func_t func,
void *  func_input 
)

Define the value of the time step thanks to a predefined function.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]funcpointer to a cs_timestep_func_t function
[in]func_inputpointer to a structure cast on-the-fly

◆ cs_domain_def_time_step_by_value()

void cs_domain_def_time_step_by_value ( cs_domain_t domain,
double  dt 
)

Define the value of the time step.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]dtvalue of the constant time step

◆ cs_domain_define_current_time_step()

void cs_domain_define_current_time_step ( cs_domain_t domain)

Set the current time step for this new time iteration.

Parameters
[in,out]domainpointer to a cs_domain_t structure

◆ cs_domain_free()

void cs_domain_free ( cs_domain_t **  p_domain)

Free a cs_domain_t structure.

Parameters
[in,out]p_domainpointer of pointer to a cs_domain_t structure

◆ cs_domain_get_boundary_name()

const char* cs_domain_get_boundary_name ( cs_domain_boundary_type_t  type)

Get the name of the domain boundary condition This name is also used as a name for zone definition.

Get the name of the domain boundary condition.

Parameters
[in]typetype of boundary
Returns
the associated boundary name

◆ cs_domain_get_cdo_mode()

int cs_domain_get_cdo_mode ( const cs_domain_t domain)

Get the mode of activation for the CDO/HHO schemes.

Parameters
[in]domainpointer to a cs_domain_t structure
Returns
the mode of activation for the CDO/HHO module

◆ cs_domain_increment_time()

void cs_domain_increment_time ( cs_domain_t domain)

Update time step after one temporal iteration.

Parameters
[in,out]domainpointer to a cs_domain_t structure

◆ cs_domain_needs_iteration()

bool cs_domain_needs_iteration ( cs_domain_t domain)

Check if one needs to continue iterations in time.

Parameters
[in,out]domainpointer to a cs_domain_t structure
Returns
true or false

◆ cs_domain_needs_log()

bool cs_domain_needs_log ( const cs_domain_t domain)

Check if an ouput is requested according to the domain setting.

Parameters
[in]domainpointer to a cs_domain_t structure
Returns
true or false

◆ cs_domain_set_cdo_mode()

void cs_domain_set_cdo_mode ( cs_domain_t domain,
int  mode 
)

Set the global variable storing the mode of activation to apply to CDO/HHO schemes.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]modetype of activation for the CDO/HHO module

◆ cs_domain_set_default_boundary()

void cs_domain_set_default_boundary ( cs_domain_t domain,
cs_domain_boundary_type_t  type 
)

Set the default boundary related to this domain.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]typetype of boundary to set

◆ cs_domain_set_output_param()

void cs_domain_set_output_param ( cs_domain_t domain,
int  nt_list,
int  verbosity 
)

Set auxiliary parameters related to the way output is done.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]nt_listoutput frequency into the listing
[in]verbositylevel of information displayed

◆ cs_domain_set_time_param()

void cs_domain_set_time_param ( cs_domain_t domain,
int  nt_max,
double  t_max 
)

Set parameters for unsteady computations: the max number of time steps or the final physical time of the simulation.

Parameters
[in,out]domainpointer to a cs_domain_t structure
[in]nt_maxmax. number of time step iterations
[in]t_maxfinal physical time of the simulation

Variable Documentation

◆ _err_empty_domain

const char _err_empty_domain[]
static
Initial value:
=
" Stop setting an empty cs_domain_t structure.\n"
" Please check your settings.\n"

◆ cs_domain_boundary_name

const char cs_domain_boundary_name[CS_DOMAIN_N_BOUNDARY_TYPES][CS_BASE_STRING_LEN]
static
Initial value:
=
{ N_("wall"),
N_("inlet"),
N_("outlet"),
N_("symmetry")
}
#define N_(String)
Definition: cs_defs.h:56

◆ cs_domain_kahan_time_compensation

double cs_domain_kahan_time_compensation = 0.0
static

◆ cs_glob_domain

cs_domain_t* cs_glob_domain = NULL