Skip to content

Commit

Permalink
Make get_wall_material_names return material name for one layer id (#408
Browse files Browse the repository at this point in the history
)

* update doc and get_wall_material_name make return only one name
  • Loading branch information
alexandrebbruno authored Sep 26, 2024
1 parent a46dd8e commit 7763eb0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
32 changes: 18 additions & 14 deletions src/alfasim_sdk/alfasim_sdk_api/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -922,34 +922,38 @@ DLL_EXPORT int get_wall_properties(void* ctx, double** prop_values, const char*
DLL_EXPORT int set_wall_properties(void* ctx, const char* prop_name, double prop_value, int control_volume_id, int layer_id);

/*!
Gets the names of the materials presented in each layer of the wall for a given control volume.
The names will be given as an array of char pointers.
Gets the name of the material for a given control volume and layer.
The names will be given as char pointer.
Example of usage:
~~~~~{.cpp}
[material_name_4]
[material_name_3] [material_name_3]
[material_name_2] [material_name_2] [material_name_2]
[material_name_1] [material_name_1] [material_name_1]
[material_name_0] [material_name_0] [material_name_0]
| | |
--[control_volume_1]--[control_volume_2]--[control_volume_3]--> (Pipe)
[material_name_4_cv_3]
[material_name_3_cv_1] [material_name_3_cv_3]
[material_name_2_cv_1] [material_name_2_cv_2] [material_name_2_cv_3]
[material_name_1_cv_1] [material_name_1_cv_2] [material_name_1_cv_3]
[material_name_0_cv_1] [material_name_0_cv_2] [material_name_0_cv_3]
| | |
--[control_volume_1]----------[control_volume_2]---------[control_volume_3]---------> (Pipe)
~~~~~
~~~~~{.cpp}
errcode = get_wall_material_names(
ctx, &material_names_in_wall, control_volume_id, &size_wall);
int layer_id = 1
int control_volume = control_volume_2
errcode = get_wall_material_name(
ctx, &material_name, control_volume_id, layer_id);
~~~~~
@param[in] ctx ALFAsim's plugins context.
@param[out] material_names_in_wall Names of the material presented in the wall.
@param[out] material_name Name of the material presented in the wall.
@param[in] control_volume_id Control volume id.
@param[out] size Size of the `material_names_in_wall` array.
@param[in] layer_id Layer id.
@return An #error_code value.
*/
DLL_EXPORT int get_wall_material_names(void* ctx, char*** material_names_in_wall, int control_volume_id, int* size);
DLL_EXPORT int get_wall_material_name(void* ctx, char** material_name, int control_volume_id, int layer_id);

/*!
Gets the information if the each layer in the wall is fluid or not for a given control volume.
Expand Down
8 changes: 4 additions & 4 deletions src/alfasim_sdk/alfasim_sdk_api/detail/api_pointers.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ using set_wall_properties_func = int (*) (
int control_volume_id,
int layer_id
);
using get_wall_material_names_func = int (*) (
using get_wall_material_name_func = int (*) (
void* ctx,
char*** wall_names,
char** wall_name,
int control_volume_id,
int* size
int layer_id
);
using get_wall_material_type_func = int (*) (
void* ctx,
Expand Down Expand Up @@ -187,7 +187,7 @@ struct ALFAsimSDK_API {

get_wall_properties_func get_wall_properties;
set_wall_properties_func set_wall_properties;
get_wall_material_names_func get_wall_material_names;
get_wall_material_name_func get_wall_material_name;
get_wall_material_type_func get_wall_material_type;

get_input_variable_func get_ucm_friction_factor_input_variable;
Expand Down
2 changes: 1 addition & 1 deletion src/alfasim_sdk/alfasim_sdk_api/detail/bootstrap_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ inline int alfasim_sdk_open(ALFAsimSDK_API* api)
api->get_wall_interfaces_temperature = (get_wall_interfaces_temperature_func)dlsym(api->handle, "get_wall_interfaces_temperature");
api->get_wall_properties = (get_wall_properties_func)dlsym(api->handle, "get_wall_properties");
api->set_wall_properties = (set_wall_properties_func)dlsym(api->handle, "set_wall_properties");
api->get_wall_material_names = (get_wall_material_names_func)dlsym(api->handle, "get_wall_material_names");
api->get_wall_material_name = (get_wall_material_name_func)dlsym(api->handle, "get_wall_material_name");
api->get_wall_material_type = (get_wall_material_type_func)dlsym(api->handle, "get_wall_material_type");
api->get_flow_pattern = (get_flow_pattern_func)dlsym(api->handle, "get_flow_pattern");
api->get_liqliq_flow_pattern = (get_flow_pattern_func)dlsym(api->handle, "get_liqliq_flow_pattern");
Expand Down
2 changes: 1 addition & 1 deletion src/alfasim_sdk/alfasim_sdk_api/detail/bootstrap_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ inline int alfasim_sdk_open(ALFAsimSDK_API* api)
api->get_wall_interfaces_temperature = (get_wall_interfaces_temperature_func)GetProcAddress(api->handle, "get_wall_interfaces_temperature");
api->get_wall_properties = (get_wall_properties_func)GetProcAddress(api->handle, "get_wall_properties");
api->set_wall_properties = (set_wall_properties_func)GetProcAddress(api->handle, "set_wall_properties");
api->get_wall_material_names = (get_wall_material_names_func)GetProcAddress(api->handle, "get_wall_material_names");
api->get_wall_material_name = (get_wall_material_name_func)GetProcAddress(api->handle, "get_wall_material_name");
api->get_wall_material_type = (get_wall_material_type_func)GetProcAddress(api->handle, "get_wall_material_type");
api->get_flow_pattern = (get_flow_pattern_func)GetProcAddress(api->handle, "get_flow_pattern");
api->get_liqliq_flow_pattern = (get_flow_pattern_func)GetProcAddress(api->handle, "get_liqliq_flow_pattern");
Expand Down

0 comments on commit 7763eb0

Please sign in to comment.