Skip to content

Commit

Permalink
Remove print statements #99
Browse files Browse the repository at this point in the history
  • Loading branch information
SudiptaBiswas committed Oct 26, 2020
1 parent 4218191 commit 4aa681d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 54 deletions.
3 changes: 0 additions & 3 deletions include/constraints/RebarBondSlipConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ class RebarBondSlipConstraint : public EqualValueEmbeddedConstraint
std::vector<unsigned int> _var_nums;
std::vector<MooseVariable *> _vars;

/// flag to turn on printing values for debugging
const bool _debug;

/// maximum bond stress
const Real _max_bondstress;

Expand Down
33 changes: 0 additions & 33 deletions src/constraints/RebarBondSlipConstraint.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ RebarBondSlipConstraint::validParams()
params.addCoupledVar(
"displacements",
"The displacements appropriate for the simulation geometry and coordinate system");
params.addParam<bool>("debug", false, "whether to print out debug messages");
params.addParam<Real>("max_bondstress", 0.0, "Maximum bond stress");
params.addParam<Real>("frictional_bondstress", 0.0, "Bond stress due to friction");

Expand All @@ -53,7 +52,6 @@ RebarBondSlipConstraint::RebarBondSlipConstraint(const InputParameters & paramet
_mesh_dimension(_mesh.dimension()),
_var_nums(_mesh_dimension, libMesh::invalid_uint),
_vars(_mesh_dimension, nullptr),
_debug(getParam<bool>("debug")),
_max_bondstress(getParam<Real>("max_bondstress")),
_frictional_bondstress(getParam<Real>("frictional_bondstress")),
_ultimate_slip(getParam<Real>("ultimate_slip")),
Expand Down Expand Up @@ -99,12 +97,6 @@ RebarBondSlipConstraint::timestepSetup()
bool
RebarBondSlipConstraint::shouldApply()
{
if (_debug)
{
std::cout << "===========================================\n";
std::cout << "node id: " << _current_node->id() << std::endl;
std::cout << "at coord: " << (Point)*_current_node << std::endl;
}
auto it = _secondary_to_primary_map.find(_current_node->id());

if (it != _secondary_to_primary_map.end())
Expand All @@ -127,7 +119,6 @@ void
RebarBondSlipConstraint::computeTangent()
{
_secondary_tangent = 0.0;

// get normals
// get connected elements of the current node
const std::map<dof_id_type, std::vector<dof_id_type>> & node_to_elem_map = _mesh.nodeToElemMap();
Expand All @@ -154,9 +145,6 @@ RebarBondSlipConstraint::computeTangent()

_secondary_tangent /= _secondary_tangent.norm();
_current_elem_volume /= elems.size();

if (_debug)
std::cout << "tangent: " << _secondary_tangent << std::endl;
}

void
Expand All @@ -174,9 +162,6 @@ RebarBondSlipConstraint::reinitConstraint()
RealVectorValue slip_normal = relative_disp - slip_axial;
Real slip_ratio = std::abs(slip) / _transitional_slip[0];

if (_debug)
std::cout << "Slip = " << slip << ".\n";

const Node * node = _current_node;
auto it = _bondslip.find(node->id());
mooseAssert(it != _bondslip.end(), "Node not found in bond-slip map");
Expand All @@ -185,18 +170,6 @@ RebarBondSlipConstraint::reinitConstraint()
bond_slip.slip_min = std::min(bond_slip.slip_min_old, slip);
bond_slip.slip_max = std::max(bond_slip.slip_max_old, slip);

if (_debug)
{
std::cout << "Slip_min = " << bond_slip.slip_min << ".\n";
std::cout << "Slip_min_old = " << bond_slip.slip_min_old << ".\n";
std::cout << "Slip_max = " << bond_slip.slip_max << ".\n";
std::cout << "Slip_max_old = " << bond_slip.slip_max_old << ".\n";
std::cout << "Bondstress_min = " << bond_slip.bondstress_min << ".\n";
std::cout << "Bondstress_min_old = " << bond_slip.bondstress_min_old << ".\n";
std::cout << "Bondstress_max = " << bond_slip.bondstress_max << ".\n";
std::cout << "Bondstress_max_old = " << bond_slip.bondstress_max_old << ".\n";
}

Real slope = 5.0 * _max_bondstress / _transitional_slip[0];
Real plastic_slip_max = bond_slip.slip_max - bond_slip.bondstress_max / slope;
Real plastic_slip_min = bond_slip.slip_min - bond_slip.bondstress_min / slope;
Expand Down Expand Up @@ -238,12 +211,6 @@ RebarBondSlipConstraint::reinitConstraint()
else
_bond_stress = _frictional_bondstress;

if (_debug)
{
std::cout << "Bondstress = " << _bond_stress << "\n";
std::cout << "Bondstress Derivative = " << _bond_stress_deriv << "\n";
}

Real bond_force = 2.0 * libMesh::pi * _bar_radius * _current_elem_volume * _bond_stress;
Real bond_force_deriv =
2.0 * libMesh::pi * _bar_radius * _current_elem_volume * _bond_stress_deriv;
Expand Down
22 changes: 4 additions & 18 deletions test/tests/rebar_bondslip/RCBeam_constraint.i
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

[GlobalParams]
displacements = 'disp_x disp_y'
# volumetric_locking_correction = true
[]

[Modules/TensorMechanics/Master]
Expand All @@ -17,7 +16,6 @@
secondinv_stress thirdinv_stress vonmises_stress
secondinv_strain thirdinv_strain
elastic_strain_xx elastic_strain_xy elastic_strain_yy'
# plastic_strain_xx plastic_strain_xy plas tic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz'
save_in = 'resid_x resid_y'
[../]
[]
Expand All @@ -29,7 +27,6 @@
area = area
displacements = 'disp_x disp_y'
save_in = 'resid_x resid_y'
# add_variables = true
[../]
[]

Expand Down Expand Up @@ -84,7 +81,6 @@
transitional_slip_values = 0.0005
ultimate_slip = 0.1
rebar_radius = 7.98e-3
# debug = true
[]
[rebar_y]
type = RebarBondSlipConstraint
Expand All @@ -98,7 +94,6 @@
transitional_slip_values = 0.0005
ultimate_slip = 0.1
rebar_radius = 7.98e-3
# debug = true
[]
[]

Expand All @@ -113,11 +108,9 @@
[BCs]
[./loading]
type = FunctionDirichletBC
# type = DirichletBC
variable = disp_x
boundary = '102'
function = loading
# value = 0.00004
preset = true
[../]
[./left_support_x]
Expand Down Expand Up @@ -244,28 +237,21 @@
[Executioner]
type = Transient
solve_type = 'PJFNK'
nl_max_its = 100
nl_abs_tol = 1.E-5
nl_rel_tol = 1E-3

line_search = none

petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'

petsc_options = '-snes_converged_reason'

nl_max_its = 100
nl_abs_tol = 1.E-5
nl_rel_tol = 1E-3
end_time = 30
dtmin = 0.00001
# num_steps = 5

num_steps = 5
dt = 0.1
[]


[Outputs]
# print_linear_residuals = false
exodus = true
csv = true
# file_base = RCBeam_bondslip_test
[]

0 comments on commit 4aa681d

Please sign in to comment.