Skip to content

Commit

Permalink
Apply the format.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfer committed May 5, 2021
1 parent 6823aa0 commit 884c283
Show file tree
Hide file tree
Showing 118 changed files with 2,934 additions and 2,821 deletions.
1,700 changes: 853 additions & 847 deletions bindings/c/src/Behaviour.cxx

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions bindings/c/src/BehaviourData.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* \file bindings/c/src/BehaviourData.cxx
* \brief
* \brief
* \author Thomas Helfer
* \date 02/08/2018
* \copyright (C) Copyright Thomas Helfer 2018.
Expand Down Expand Up @@ -42,7 +42,7 @@ mgis_status mgis_bv_behaviour_data_get_behaviour(
return mgis_report_success();
} // end of mgis_bv_update_behaviour_data

mgis_status mgis_bv_update_behaviour_data(mgis_bv_BehaviourData* const d){
mgis_status mgis_bv_update_behaviour_data(mgis_bv_BehaviourData* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (behaviour data is null)");
}
Expand All @@ -52,7 +52,7 @@ mgis_status mgis_bv_update_behaviour_data(mgis_bv_BehaviourData* const d){
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_update_behaviour_data
} // end of mgis_bv_update_behaviour_data

mgis_status mgis_bv_revert_behaviour_data(mgis_bv_BehaviourData* const d) {
if (d == nullptr) {
Expand All @@ -64,19 +64,19 @@ mgis_status mgis_bv_revert_behaviour_data(mgis_bv_BehaviourData* const d) {
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_revert_behaviour_data
} // end of mgis_bv_revert_behaviour_data

mgis_status mgis_bv_behaviour_data_get_state_0(
mgis_bv_State** s, mgis_bv_BehaviourData* const d) {
mgis_status mgis_bv_behaviour_data_get_state_0(mgis_bv_State** s,
mgis_bv_BehaviourData* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (behaviour data is null)");
}
*s = &(d->s0);
return mgis_report_success();
} // end of mgis_bv_behaviour_data_get_state_0

mgis_status mgis_bv_behaviour_data_get_state_1(
mgis_bv_State** s, mgis_bv_BehaviourData* const d) {
mgis_status mgis_bv_behaviour_data_get_state_1(mgis_bv_State** s,
mgis_bv_BehaviourData* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (behaviour data is null)");
}
Expand All @@ -101,7 +101,7 @@ mgis_status mgis_bv_behaviour_data_get_time_step_scaling_factor(
}
*rdt = d->rdt;
return mgis_report_success();
} // end of mgis_bv_behaviour_data_get_time_step_scaling_factor
} // end of mgis_bv_behaviour_data_get_time_step_scaling_factor

mgis_status mgis_bv_behaviour_data_get_tangent_operator(
mgis_real** const K, mgis_bv_BehaviourData* const d) {
Expand All @@ -115,13 +115,13 @@ mgis_status mgis_bv_behaviour_data_get_tangent_operator(
}
*K = &(d->K[0]);
return mgis_report_success();
} // end of mgis_bv_behaviour_data_get_tangent_operator
} // end of mgis_bv_behaviour_data_get_tangent_operator

mgis_status mgis_bv_free_behaviour_data(mgis_bv_BehaviourData** d) {
try {
delete *d;
} catch (...) {
return mgis_handle_cxx_exception();
} catch (...) {
return mgis_handle_cxx_exception();
}
*d = nullptr;
return mgis_report_success();
Expand Down
8 changes: 4 additions & 4 deletions bindings/c/src/BehaviourDataView.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* \file bindings/c/src/BehaviourDataView.cxx
* \brief
* \brief
* \author th202608
* \date 02/08/2018
* \copyright (C) Copyright Thomas Helfer 2018.
Expand All @@ -18,10 +18,10 @@ extern "C" {

mgis_status mgis_bv_make_behaviour_data_view(mgis_bv_BehaviourDataView* const v,
mgis_bv_BehaviourData* const d) {
if(v==nullptr){
if (v == nullptr) {
return mgis_report_failure("uninitialized view");
}
if(d==nullptr){
if (d == nullptr) {
return mgis_report_failure("uninitialized behaviour data");
}
try {
Expand All @@ -32,4 +32,4 @@ mgis_status mgis_bv_make_behaviour_data_view(mgis_bv_BehaviourDataView* const v,
return mgis_report_success();
} // end of mgis_bv_make_behaviour_data_view

} // end of extern "C"
} // end of extern "C"
3 changes: 1 addition & 2 deletions bindings/c/src/Hypothesis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ mgis_status mgis_bv_get_tensor_size(mgis_size_type* const s,
*s = 5u;
} else if (::strcmp(h, "Tridimensional") == 0) {
*s = 9u;
}
else {
} else {
return mgis_report_failure(
"mgis_bv_get_tensor_size: "
"unsupported hypothesis");
Expand Down
19 changes: 10 additions & 9 deletions bindings/c/src/Integrate.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* \file Integrate.cxx
* \brief
* \brief
* \author th202608
* \date 02/08/2018
* \copyright Copyright (C) 2006-2018 CEA/DEN, EDF R&D. All rights
Expand All @@ -21,7 +21,7 @@ extern "C" {

static mgis::behaviour::IntegrationType convertIntegrationType(
const mgis_bv_IntegrationType i) {
switch(i) {
switch (i) {
case MGIS_BV_PREDICTION_TANGENT_OPERATOR:
return mgis::behaviour::IntegrationType::PREDICTION_TANGENT_OPERATOR;
case MGIS_BV_PREDICTION_SECANT_OPERATOR:
Expand All @@ -37,12 +37,13 @@ static mgis::behaviour::IntegrationType convertIntegrationType(
case MGIS_BV_INTEGRATION_TANGENT_OPERATOR:
return mgis::behaviour::IntegrationType::INTEGRATION_TANGENT_OPERATOR;
case MGIS_BV_INTEGRATION_CONSISTENT_TANGENT_OPERATOR:
return mgis::behaviour::IntegrationType::INTEGRATION_CONSISTENT_TANGENT_OPERATOR;
return mgis::behaviour::IntegrationType::
INTEGRATION_CONSISTENT_TANGENT_OPERATOR;
default:
mgis::raise("convertIntegrationType: invalid integration type");
}
return mgis::behaviour::IntegrationType::INTEGRATION_NO_TANGENT_OPERATOR;
} // end of convertIntegrationType
} // end of convertIntegrationType

mgis_status mgis_bv_integrate(int* const r,
mgis_bv_BehaviourDataView* const d,
Expand All @@ -55,8 +56,8 @@ mgis_status mgis_bv_integrate(int* const r,
} // end of mgis_bv_integrate

mgis_status mgis_bv_integrate_2(int* const r,
mgis_bv_BehaviourData* const d,
const mgis_bv_Behaviour* const b) {
mgis_bv_BehaviourData* const d,
const mgis_bv_Behaviour* const b) {
auto v = mgis::behaviour::make_view(*d);
auto s = mgis_bv_integrate(r, &v, b);
d->rdt = v.rdt;
Expand All @@ -79,7 +80,7 @@ mgis_status mgis_bv_integrate_material_data_manager(
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_integrate_material_data_manager
} // end of mgis_bv_integrate_material_data_manager

mgis_status mgis_bv_integrate_material_data_manager_part(
int* const r,
Expand All @@ -98,6 +99,6 @@ mgis_status mgis_bv_integrate_material_data_manager_part(
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_integrate_material_data_manager_part
} // end of mgis_bv_integrate_material_data_manager_part

} // end of extern "C"
} // end of extern "C"
35 changes: 21 additions & 14 deletions bindings/c/src/MaterialDataManager.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* \file MaterialDataManager.cxx
* \brief
* \brief
* \author Thomas Helfer
* \date 05/08/2018
* \copyright (C) Copyright Thomas Helfer 2018.
Expand Down Expand Up @@ -58,7 +58,8 @@ mgis_status mgis_bv_material_data_manager_initializer_get_state_0_initializer(
mgis_bv_MaterialStateManagerInitializer** s,
mgis_bv_MaterialDataManagerInitializer* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (material data manager is null)");
return mgis_report_failure(
"invalid argument (material data manager is null)");
}
*s = &(d->s0);
return mgis_report_success();
Expand All @@ -68,7 +69,8 @@ mgis_status mgis_bv_material_data_manager_initializer_get_state_1_initializer(
mgis_bv_MaterialStateManagerInitializer** s,
mgis_bv_MaterialDataManagerInitializer* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (material data manager is null)");
return mgis_report_failure(
"invalid argument (material data manager is null)");
}
*s = &(d->s1);
return mgis_report_success();
Expand All @@ -84,7 +86,7 @@ mgis_status mgis_bv_free_material_data_manager_initializer(
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_free_material_data_manager_initializer
} // end of mgis_bv_free_material_data_manager_initializer

mgis_status mgis_bv_create_material_data_manager(
mgis_bv_MaterialDataManager** d,
Expand Down Expand Up @@ -136,7 +138,8 @@ mgis_status mgis_bv_create_material_data_manager_with_initializer(
mgis_status mgis_bv_material_data_manager_get_state_0(
mgis_bv_MaterialStateManager** s, mgis_bv_MaterialDataManager* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (material data manager is null)");
return mgis_report_failure(
"invalid argument (material data manager is null)");
}
*s = &(d->s0);
return mgis_report_success();
Expand All @@ -145,7 +148,8 @@ mgis_status mgis_bv_material_data_manager_get_state_0(
mgis_status mgis_bv_material_data_manager_get_state_1(
mgis_bv_MaterialStateManager** s, mgis_bv_MaterialDataManager* const d) {
if (d == nullptr) {
return mgis_report_failure("invalid argument (material data manager is null)");
return mgis_report_failure(
"invalid argument (material data manager is null)");
}
*s = &(d->s1);
return mgis_report_success();
Expand All @@ -164,27 +168,30 @@ mgis_status mgis_bv_material_data_manager_get_tangent_operator(
}
*K = &(Kv[0]);
return mgis_report_success();
} // end of mgis_bv_material_data_manager_get_tangent_operator

mgis_status mgis_bv_update_material_data_manager(mgis_bv_MaterialDataManager* const d){
} // end of mgis_bv_material_data_manager_get_tangent_operator

mgis_status mgis_bv_update_material_data_manager(
mgis_bv_MaterialDataManager* const d) {
try {
mgis::behaviour::update(*d);
} catch (...) {
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_update_material_data_manager
} // end of mgis_bv_update_material_data_manager

mgis_status mgis_bv_revert_material_data_manager(mgis_bv_MaterialDataManager* const d){
mgis_status mgis_bv_revert_material_data_manager(
mgis_bv_MaterialDataManager* const d) {
try {
mgis::behaviour::revert(*d);
} catch (...) {
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_revert_material_data_manager
} // end of mgis_bv_revert_material_data_manager

mgis_status mgis_bv_free_material_data_manager(mgis_bv_MaterialDataManager** d){
mgis_status mgis_bv_free_material_data_manager(
mgis_bv_MaterialDataManager** d) {
try {
delete *d;
*d = nullptr;
Expand All @@ -193,6 +200,6 @@ mgis_status mgis_bv_free_material_data_manager(mgis_bv_MaterialDataManager** d){
return mgis_handle_cxx_exception();
}
return mgis_report_success();
} // end of mgis_bv_free_material_data_manager
} // end of mgis_bv_free_material_data_manager

} // end of extern "C"
Loading

0 comments on commit 884c283

Please sign in to comment.