3D-ICE 3.0.0
Data Structures | Typedefs | Functions
layer.h File Reference
#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.

Data Structures

struct  Layer_t
 Structure used to store data about the layers that compose the 2D/3D stack. More...
 

Typedefs

typedef struct Layer_t Layer_t
 

Functions

void layer_init (Layer_t *layer)
 
void layer_copy (Layer_t *dst, Layer_t *src)
 
void layer_destroy (Layer_t *layer)
 
Layer_tlayer_calloc (void)
 
Layer_tlayer_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)
 

Typedef Documentation

◆ Layer_t

typedef struct Layer_t Layer_t

Definition of the type Layer_t

Definition at line 104 of file layer.h.

Function Documentation

◆ fill_layout()

Error_t fill_layout ( Layer_t layer,
Dimensions_t dimensions,
MaterialList_t *  materials,
String_t  filename 
)

Parses the layout file and fills the MaterialLayout structure

FIXME is this the right place ? do we need a strucure as floorplan?

Parameters
layerthe layer structure to fill
dimensionspointer to the structure storing the dimensions of the stack
materialsthe list of materials already known
filenamepath 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()

SolidTC_t get_thermal_conductivity ( Layer_t layer,
CellIndex_t  row_index,
CellIndex_t  column_index,
Dimensions_t dimensions 
)

Returns the thermal conductivity of a cell in a given location

Parameters
layerthe layer structure to query
row_indexthe index of the row of the thermal cell
column_indexthe index of the column of the thermal cell
dimensionspointer 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()

SolidVHC_t get_volumetric_heat_capacity ( Layer_t layer,
CellIndex_t  row_index,
CellIndex_t  column_index,
Dimensions_t dimensions 
)

Returns the volumetric heat capacity of a cell in a given location

Parameters
layerthe layer structure to query
row_indexthe index of the row of the thermal cell
column_indexthe index of the column of the thermal cell
dimensionspointer 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()

Layer_t * layer_calloc ( void  )

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()

Layer_t * layer_clone ( Layer_t layer)

Allocates memory for a new copy of the structure layer

Parameters
layerthe 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()

void layer_copy ( Layer_t dst,
Layer_t src 
)

Copies the structure src into dst , as an assignement

The function destroys the content of dst and then makes the copy

Parameters
dstthe address of the left term sructure (destination)
srcthe 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
layerthe address of the structure to destroy

Definition at line 80 of file layer.c.

◆ layer_free()

void layer_free ( Layer_t layer)

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
layerthe pointer to free

Definition at line 124 of file layer.c.

◆ layer_init()

void layer_init ( Layer_t layer)

Inits the fields of the layer structure with default values

Parameters
layerthe address of the structure to initalize

Definition at line 46 of file layer.c.

◆ layer_print()

void layer_print ( Layer_t layer,
FILE *  stream,
String_t  prefix 
)

Prints the layer declaration as it looks in the stack file

Parameters
layerthe address of the structure to print
streamthe output stream (must be already open)
prefixa string to be printed as prefix at the beginning of each line

Definition at line 144 of file layer.c.

◆ layer_same_id()

bool layer_same_id ( Layer_t layer,
Layer_t other 
)

Tests if two layers have the same Id

Parameters
layerthe first layer
otherthe second layer
Returns
TRUE if layer and other have the same Id
FALSE otherwise

Definition at line 137 of file layer.c.