Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Oct 31, 2023
1 parent f19f721 commit 046dbed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
30 changes: 9 additions & 21 deletions Element/ElementParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ void new_dkt3(unique_ptr<Element>& return_obj, istringstream& command) {
return;
}

unsigned num_ip = 3;
auto num_ip = 3u;
if(!get_optional_input(command, num_ip)) {
suanpan_error("A valid number of integration points is required.\n");
return;
Expand Down Expand Up @@ -1291,7 +1291,7 @@ void new_dkt4(unique_ptr<Element>& return_obj, istringstream& command) {
return;
}

unsigned num_ip = 3;
auto num_ip = 3u;
if(!get_optional_input(command, num_ip)) {
suanpan_error("A valid number of integration points is required.\n");
return;
Expand Down Expand Up @@ -1325,7 +1325,7 @@ void new_dkts3(unique_ptr<Element>& return_obj, istringstream& command) {
return;
}

unsigned num_ip = 3;
auto num_ip = 3u;
if(!get_optional_input(command, num_ip)) {
suanpan_error("A valid number of integration points is required.\n");
return;
Expand Down Expand Up @@ -1462,13 +1462,13 @@ void new_f21(unique_ptr<Element>& return_obj, istringstream& command) {
return;
}

unsigned int_pt = 6;
auto int_pt = 6u;
if(!get_optional_input(command, int_pt)) {
suanpan_error("A valid number of integration points is required.\n");
return;
}

unsigned nonlinear = 0;
auto nonlinear = 0u;
if(command.eof())
suanpan_debug("Linear geometry assumed.\n");
else if(!get_input(command, nonlinear))
Expand Down Expand Up @@ -1910,16 +1910,8 @@ void new_pcpedc(unique_ptr<Element>& return_obj, istringstream& command, const u
}

double alpha, n, k;
if(!get_optional_input(command, alpha)) {
suanpan_error("A valid alpha is required.\n");
return;
}
if(!get_optional_input(command, n)) {
suanpan_error("A valid porosity is required.\n");
return;
}
if(!get_optional_input(command, k)) {
suanpan_error("A valid permeability is required.\n");
if(!get_input(command, alpha, n, k)) {
suanpan_error("A valid parameter is required.\n");
return;
}

Expand Down Expand Up @@ -1952,12 +1944,8 @@ void new_pcpeuc(unique_ptr<Element>& return_obj, istringstream& command, const u
}

double alpha, n;
if(!get_optional_input(command, alpha)) {
suanpan_error("A valid alpha is required.\n");
return;
}
if(!get_optional_input(command, n)) {
suanpan_error("A valid porosity is required.\n");
if(!get_input(command, alpha, n)) {
suanpan_error("A valid parameter is required.\n");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Example/Element/PCPE8UC.supan
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ node 8 0 1
material Elastic2D 1 1500 .25 1E-4 1
material Fluid 2 1000 1E-4

element PCPE8UC 1 1 2 3 4 5 6 7 8 1 2 1. .8 1E1
element PCPE8UC 1 1 2 3 4 5 6 7 8 1 2 1. .8

fix 1 1 1 2 3 4 6 8
fix 2 2 1 2 5
Expand Down
2 changes: 1 addition & 1 deletion Material/MaterialParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,7 @@ void new_substepping(unique_ptr<Material>& return_obj, istringstream& command) {
return;
}

unsigned max_iteration = 20;
auto max_iteration = 20u;
if(!get_optional_input(command, max_iteration)) {
suanpan_error("A valid maximum iteration is required.\n");
return;
Expand Down
1 change: 0 additions & 1 deletion Toolbox/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ void perform_upsampling(istringstream& command) {
}

string window_type = "Hamming";

if(!get_optional_input(command, window_type)) {
suanpan_error("A valid window type is required.\n");
return;
Expand Down

0 comments on commit 046dbed

Please sign in to comment.