9.0
general documentation
Loading...
Searching...
No Matches
cs_notebook.cpp File Reference
#include "base/cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft/bft_error.h"
#include "bft/bft_printf.h"
#include "gui/cs_gui_util.h"
#include "base/cs_log.h"
#include "base/cs_map.h"
#include "base/cs_mem.h"
#include "base/cs_parameters.h"
#include "base/cs_notebook.h"
Include dependency graph for cs_notebook.cpp:

Functions

void cs_notebook_load_from_file (void)
 Initialize the notebook object (based on cs_tree_node_t).
int cs_notebook_parameter_is_present (const char *name, int *editable)
 Check if a parameter value is present.
cs_real_t cs_notebook_parameter_value_by_name (const char *name)
 Return a parameter value (real).
void cs_notebook_parameter_set_value (const char *name, cs_real_t val)
 Set a parameter value (real) for an editable parameter.
int cs_notebook_parameter_get_openturns_status (char *name)
 Indicate whether the parameter is used for a study with openturns.
const char * cs_notebook_parameter_get_description (char *name)
 Returns the description of the parameter (GUI defined).
int cs_notebook_parameter_get_id (const char *name)
 Get id associated with a notebook parameter.
void cs_notebook_get_values (int n, const int ids[], double values[])
 Get a group of notebook variable values.
void cs_notebook_set_values (int n, const int ids[], const double values[])
 Set a group of notebook variable values.
void cs_notebook_destroy_all (void)
 Destroy the notebook structure.
void cs_notebook_log_setup (void)
 Output the notebook info to the setup log.
void cs_notebook_log (void)
 Print values of notebook variables to default log file.
int cs_notebook_nb_var (void)
 Number of notebook variables.
bool cs_notebook_var_is_editable (const int id)
 Indicate if the notebook parameter is editable.
bool cs_notebook_var_is_read_from_checkpoint (const int id)
 Indicate if the notebook parameter is read at restart.
void cs_notebook_var_change_editable (int id, const bool val)
 Change the editable property of the notebook parameter.
const char * cs_notebook_name_by_id (int id)
 Get name of a notebook parameter based on its id.
void cs_notebook_uncertain_output (void)
 Write uncertain values to output file.

Function Documentation

◆ cs_notebook_destroy_all()

void cs_notebook_destroy_all ( void )

Destroy the notebook structure.

Destroys the structures related to the notebook.

◆ cs_notebook_get_values()

void cs_notebook_get_values ( int n,
const int ids[],
double values[] )

Get a group of notebook variable values.

Parameters
[in]nnumber of notebook variables to query
[in]idsids of notebook variables to query (value set to 0 where id < 0)
[out]valuesvalues of notebook variables to query

◆ cs_notebook_load_from_file()

void cs_notebook_load_from_file ( void )

Initialize the notebook object (based on cs_tree_node_t).

◆ cs_notebook_log()

void cs_notebook_log ( void )

Print values of notebook variables to default log file.

Print values of editable notebook variables to default log file.

◆ cs_notebook_log_setup()

void cs_notebook_log_setup ( void )

Output the notebook info to the setup log.

◆ cs_notebook_name_by_id()

const char * cs_notebook_name_by_id ( int id)

Get name of a notebook parameter based on its id.

Parameters
[in]idId of the notebook parameter
[out]nameName of the notebook parameter
Returns
name of variable (char *)

◆ cs_notebook_nb_var()

int cs_notebook_nb_var ( void )

Number of notebook variables.

Returns
number of notebook variables (int)

◆ cs_notebook_parameter_get_description()

const char * cs_notebook_parameter_get_description ( char * name)

Returns the description of the parameter (GUI defined).

Parameters
[in]namename of the parameter
Returns
a const char pointer containing the description.

◆ cs_notebook_parameter_get_id()

int cs_notebook_parameter_get_id ( const char * name)

Get id associated with a notebook parameter.

Parameters
[in]namename of the parameter
Returns
-1 if not present, id if present

◆ cs_notebook_parameter_get_openturns_status()

int cs_notebook_parameter_get_openturns_status ( char * name)

Indicate whether the parameter is used for a study with openturns.

Returns an int flag to indicate whether this paramter is used for an OpenTurns study. -1 : The parameter is not used with OpenTurns 0 : The parameter is used as an input from OpenTurns 1 : The parameter is used as an output to OpenTurns

Parameters
[in]namename of the parameter
Returns
an int flag value

◆ cs_notebook_parameter_is_present()

int cs_notebook_parameter_is_present ( const char * name,
int * editable )

Check if a parameter value is present.

Parameters
[in]namename of the parameter
[out]editable1 if the value is editable, 0 otherwise (optional)
Returns
0 if not present, 1 if present

◆ cs_notebook_parameter_set_value()

void cs_notebook_parameter_set_value ( const char * name,
cs_real_t val )

Set a parameter value (real) for an editable parameter.

The name used is the same as the one in the GUI.

Parameters
[in]namename of the parameter
[in]valvalue of the parameter

◆ cs_notebook_parameter_value_by_name()

cs_real_t cs_notebook_parameter_value_by_name ( const char * name)

Return a parameter value (real).

The name used is the same as the one in the GUI.

Parameters
[in]namename of the parameter
Returns
value of the given parameter

◆ cs_notebook_set_values()

void cs_notebook_set_values ( int n,
const int ids[],
const double values[] )

Set a group of notebook variable values.

Parameters
[in]nnumber of notebook variables to set
[in]idsids of notebook variables to set (ignored where id < 0)
[in]valuesvalues of notebook variables to set

◆ cs_notebook_uncertain_output()

void cs_notebook_uncertain_output ( void )

Write uncertain values to output file.

If input and output uncertain variables are provided, output values are written to an output file: cs_uncertain_output.dat Results are ordered in the definition order in the notebook.

◆ cs_notebook_var_change_editable()

void cs_notebook_var_change_editable ( int id,
const bool val )

Change the editable property of the notebook parameter.

Parameters
[in]idId of the notebook parameter
[in]valflag (bool) indicating if the value is set to editable

◆ cs_notebook_var_is_editable()

bool cs_notebook_var_is_editable ( const int id)

Indicate if the notebook parameter is editable.

Returns a boolean to indicate wheter this parameter is editable

Parameters
[in]idId of the notebook parameter
Returns
true is variable can be edited, false otherwise

◆ cs_notebook_var_is_read_from_checkpoint()

bool cs_notebook_var_is_read_from_checkpoint ( const int id)

Indicate if the notebook parameter is read at restart.

Returns a boolean to indicate wheter this parameter is read at restart

Parameters
[in]idId of the notebook parameter
Returns
true if variable should be read from checkpoint file, false otherwise