#include <stdio.h>
#include "types.h"
#include "string_t.h"
#include "material.h"
#include "material_list.h"
#include "dimensions.h"
#include "material_element_list.h"
Go to the source code of this file.
|
struct | Layer_t |
| Structure used to store data about the layers that compose the 2D/3D stack. More...
|
|
|
void | layer_init (Layer_t *layer) |
|
void | layer_copy (Layer_t *dst, Layer_t *src) |
|
void | layer_destroy (Layer_t *layer) |
|
Layer_t * | layer_calloc (void) |
|
Layer_t * | layer_clone (Layer_t *layer) |
|
void | layer_free (Layer_t *layer) |
|
bool | layer_same_id (Layer_t *layer, Layer_t *other) |
|
void | layer_print (Layer_t *layer, FILE *stream, String_t prefix) |
|
Error_t | fill_layout (Layer_t *layer, Dimensions_t *dimensions, MaterialList_t *materials, String_t filename) |
|
SolidTC_t | get_thermal_conductivity (Layer_t *layer, CellIndex_t row_index, CellIndex_t column_index, Dimensions_t *dimensions) |
|
SolidVHC_t | get_volumetric_heat_capacity (Layer_t *layer, CellIndex_t row_index, CellIndex_t column_index, Dimensions_t *dimensions) |
|
◆ Layer_t
◆ fill_layout()
Parses the layout file and fills the MaterialLayout structure
FIXME is this the right place ? do we need a strucure as floorplan?
- Parameters
-
layer | the layer structure to fill |
dimensions | pointer to the structure storing the dimensions of the stack |
materials | the list of materials already known |
filename | path to the floorplan file to parse |
- Returns
TDICE_FAILURE
if the file cannot be opened or if the parsing of the floorplan fails
-
TDICE_FAILURE
otherwise
Definition at line 165 of file layer.c.
◆ get_thermal_conductivity()
Returns the thermal conductivity of a cell in a given location
- Parameters
-
layer | the layer structure to query |
row_index | the index of the row of the thermal cell |
column_index | the index of the column of the thermal cell |
dimensions | pointer to the structure storing the dimensions of the stack |
- Returns
- The thermal conductivity of the cell in location (row_index, column_index )
Definition at line 186 of file layer.c.
◆ get_volumetric_heat_capacity()
Returns the volumetric heat capacity of a cell in a given location
- Parameters
-
layer | the layer structure to query |
row_index | the index of the row of the thermal cell |
column_index | the index of the column of the thermal cell |
dimensions | pointer to the structure storing the dimensions of the stack |
- Returns
- The volumetric heat capacity of the cell in location (row_index, column_index )
Definition at line 214 of file layer.c.
◆ layer_calloc()
Allocates memory for a structure of type Layer_t
The content of the new structure is set to default values calling layer_init
- Returns
- the pointer to the new structure
-
NULL
if the memory allocation fails
Definition at line 94 of file layer.c.
◆ layer_clone()
Allocates memory for a new copy of the structure layer
- Parameters
-
layer | the address of the structure to clone |
- Returns
- a pointer to a new structure
-
NULL
if the memory allocation fails
-
NULL
if the parameter layer is NULL
Definition at line 107 of file layer.c.
◆ layer_copy()
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
- Parameters
-
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
Definition at line 62 of file layer.c.
◆ layer_destroy()
void layer_destroy |
( |
Layer_t * |
layer | ) |
|
Destroys the content of the fields of the structure layer
The function releases any dynamic memory used by the structure and resets its state calling layer_init .
- Parameters
-
layer | the address of the structure to destroy |
Definition at line 80 of file layer.c.
◆ layer_free()
Frees the memory space pointed by layer
The function destroys the structure layer and then frees its memory. The pointer layer must have been returned by a previous call to layer_calloc or layer_clone .
If layer is NULL
, no operation is performed.
- Parameters
-
Definition at line 124 of file layer.c.
◆ layer_init()
Inits the fields of the layer structure with default values
- Parameters
-
layer | the address of the structure to initalize |
Definition at line 46 of file layer.c.
◆ layer_print()
Prints the layer declaration as it looks in the stack file
- Parameters
-
layer | the address of the structure to print |
stream | the output stream (must be already open) |
prefix | a string to be printed as prefix at the beginning of each line |
Definition at line 144 of file layer.c.
◆ layer_same_id()
Tests if two layers have the same Id
- Parameters
-
layer | the first layer |
other | the second layer |
- Returns
TRUE
if layer and other have the same Id
-
FALSE
otherwise
Definition at line 137 of file layer.c.