3D-ICE 3.0.0
Data Structures | Typedefs | Functions
material_element.h File Reference
#include <stdio.h>
#include "types.h"
#include "string_t.h"
#include "dimensions.h"
#include "material.h"
#include "ic_element_list.h"

Go to the source code of this file.

Data Structures

struct  MaterialElement_t
 

Typedefs

typedef struct MaterialElement_t MaterialElement_t
 

Functions

void material_element_init (MaterialElement_t *melement)
 
void material_element_copy (MaterialElement_t *dst, MaterialElement_t *src)
 
void material_element_destroy (MaterialElement_t *melement)
 
MaterialElement_tmaterial_element_calloc (void)
 
MaterialElement_tmaterial_element_clone (MaterialElement_t *melement)
 
void material_element_free (MaterialElement_t *melement)
 
bool material_element_same_material (MaterialElement_t *melement, MaterialElement_t *other)
 
void material_element_print (MaterialElement_t *melement, FILE *stream, String_t prefix)
 
Material_tget_material_at_location (MaterialElement_t *melement, CellIndex_t row_index, CellIndex_t column_index, Dimensions_t *dimensions)
 

Typedef Documentation

◆ MaterialElement_t

Definition of the type MaterialElement_t

Definition at line 86 of file material_element.h.

Function Documentation

◆ get_material_at_location()

Material_t * get_material_at_location ( MaterialElement_t melement,
CellIndex_t  row_index,
CellIndex_t  column_index,
Dimensions_t dimensions 
)

Returns the material of a thermal cell in a given location

Parameters
melementthe address of the material element
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
NULL if the material of the thermal cell in position (row_index, column_index ) is not found
The address of the material of the thermal cell in position (row_index, column_index )

Definition at line 161 of file material_element.c.

◆ material_element_calloc()

MaterialElement_t * material_element_calloc ( void  )

Allocates memory for a structure of type MatrerialElement_t

The content of the new structure is set to default values calling material_element_init

Returns
the pointer to the new structure
NULL if the memory allocation fails

Definition at line 85 of file material_element.c.

◆ material_element_clone()

MaterialElement_t * material_element_clone ( MaterialElement_t melement)

Allocates memory for a new copy of the structure mpel

Parameters
melementthe address of the structure to clone
Returns
a pointer to a new structure
NULL if the memory allocation fails
NULL if the parameter mpel is NULL

Definition at line 100 of file material_element.c.

◆ material_element_copy()

void material_element_copy ( MaterialElement_t dst,
MaterialElement_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 57 of file material_element.c.

◆ material_element_destroy()

void material_element_destroy ( MaterialElement_t melement)

Destroys the content of the fields of the structure mpel

The function releases any dynamic memory used by the structure and resets its state calling material_element_init .

Parameters
melementthe address of the structure to destroy

Definition at line 74 of file material_element.c.

◆ material_element_free()

void material_element_free ( MaterialElement_t melement)

Frees the memory space pointed by melement

The function destroys the structure melement and then frees its memory. The pointer melement must have been returned by a previous call to material_element_calloc or material_element_clone .

If melement is NULL, no operation is performed.

Parameters
melementthe pointer to free

Definition at line 117 of file material_element.c.

◆ material_element_init()

void material_element_init ( MaterialElement_t melement)

Inits the fields of the melement structure with default values

Parameters
melementthe address of the structure to initalize

Definition at line 46 of file material_element.c.

◆ material_element_print()

void material_element_print ( MaterialElement_t melement,
FILE *  stream,
String_t  prefix 
)

Prints the material element structure as it looks in the material layout file

Parameters
melementthe 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 141 of file material_element.c.

◆ material_element_same_material()

bool material_element_same_material ( MaterialElement_t melement,
MaterialElement_t other 
)

Tests if two material elements have the same Material

Parameters
melementthe first material element
otherthe second material element
Returns
TRUE if melement and other have the same Material
FALSE otherwise

Definition at line 130 of file material_element.c.