Skip to content

Commit

Permalink
Remove unused default constructors and set_param
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Jan 9, 2025
1 parent 71be75d commit e5973cd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 119 deletions.
15 changes: 0 additions & 15 deletions src/CabanaPD_ForceModels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ struct BaseForceModel
{
double delta;

BaseForceModel(){};
BaseForceModel( const double _delta )
: delta( _delta ){};

BaseForceModel( const BaseForceModel& model ) { delta = model.delta; }

// No-op for temperature.
KOKKOS_INLINE_FUNCTION
void thermalStretch( double&, const int, const int ) const {}
Expand Down Expand Up @@ -55,12 +52,6 @@ struct BaseTemperatureModel
temperature = model.temperature;
}

void set_param( const double _alpha, const double _temp0 )
{
alpha = _alpha;
temp0 = _temp0;
}

void update( const TemperatureType _temp ) { temperature = _temp; }

// Update stretch with temperature effects.
Expand All @@ -87,12 +78,6 @@ struct BaseDynamicTemperatureModel
BaseDynamicTemperatureModel( const double _delta, const double _kappa,
const double _cp,
const bool _constant_microconductivity = true )
{
set_param( _delta, _kappa, _cp, _constant_microconductivity );
}

void set_param( const double _delta, const double _kappa, const double _cp,
const bool _constant_microconductivity )
{
delta = _delta;
kappa = _kappa;
Expand Down
1 change: 0 additions & 1 deletion src/CabanaPD_Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ class SolverNoFracture
// Optional modules.
std::shared_ptr<heat_transfer_type> heat_transfer;
std::shared_ptr<contact_type> contact;
contact_model_type contact_model;

// Output files.
std::string output_file;
Expand Down
9 changes: 0 additions & 9 deletions src/force/CabanaPD_ContactModels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ struct ContactModel
double delta;
double Rc;

ContactModel(){};
// PD horizon
// Contact radius
ContactModel( const double _delta, const double _Rc )
Expand All @@ -51,18 +50,10 @@ struct NormalRepulsionModel : public ContactModel
double c;
double K;

NormalRepulsionModel(){};
NormalRepulsionModel( const double delta, const double Rc, const double _K )
: ContactModel( delta, Rc )
, K( _K )
{
set_param( delta, Rc, K );
}

void set_param( const double _delta, const double _Rc, const double _K )
{
delta = _delta;
Rc = _Rc;
K = _K;
// This could inherit from PMB (same c)
c = 18.0 * K / ( pi * delta * delta * delta * delta );
Expand Down
20 changes: 3 additions & 17 deletions src/force/CabanaPD_ForceModels_LPS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,9 @@ struct ForceModel<LPS, Elastic, NoFracture> : public BaseForceModel
const int _influence = 0 )
: base_type( _delta )
, influence_type( _influence )
, K( _K )
, G( _G )
{
set_param( _delta, _K, _G );
}

void set_param( const double _delta, const double _K, const double _G )
{
delta = _delta;
K = _K;
G = _G;

theta_coeff = 3.0 * K - 5.0 * G;
s_coeff = 15.0 * G;
}
Expand Down Expand Up @@ -85,15 +78,8 @@ struct ForceModel<LPS, Elastic, Fracture>
ForceModel( const double _delta, const double _K, const double _G,
const double _G0, const int _influence = 0 )
: base_type( _delta, _K, _G, _influence )
, G0( _G0 )
{
set_param( _delta, _K, _G, _G0 );
}

void set_param( const double _delta, const double _K, const double _G,
const double _G0 )
{
base_type::set_param( _delta, _K, _G );
G0 = _G0;
if ( influence_type == 1 )
{
s0 = Kokkos::sqrt( 5.0 * G0 / 9.0 / K / delta ); // 1/xi
Expand Down
77 changes: 6 additions & 71 deletions src/force/CabanaPD_ForceModels_PMB.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,10 @@ struct ForceModel<PMB, Elastic, NoFracture, TemperatureIndependent>
double c;
double K;

ForceModel( const double delta, const double K )
ForceModel( const double delta, const double _K )
: base_type( delta )
, K( _K )
{
set_param( delta, K );
}

ForceModel( const ForceModel& model )
: base_type( model )
{
c = model.c;
K = model.K;
}

void set_param( const double _delta, const double _K )
{
delta = _delta;
K = _K;
c = 18.0 * K / ( pi * delta * delta * delta * delta );
}
};
Expand All @@ -71,24 +58,10 @@ struct ForceModel<PMB, Elastic, Fracture, TemperatureIndependent>
double s0;
double bond_break_coeff;

ForceModel( const double delta, const double K, const double G0 )
ForceModel( const double delta, const double K, const double _G0 )
: base_type( delta, K )
, G0( _G0 )
{
set_param( delta, K, G0 );
}

ForceModel( const ForceModel& model )
: base_type( model )
{
G0 = model.G0;
s0 = model.s0;
bond_break_coeff = model.bond_break_coeff;
}

void set_param( const double _delta, const double _K, const double _G0 )
{
base_type::set_param( _delta, _K );
G0 = _G0;
s0 = Kokkos::sqrt( 5.0 * G0 / 9.0 / K / delta );
bond_break_coeff = ( 1.0 + s0 ) * ( 1.0 + s0 );
}
Expand Down Expand Up @@ -167,14 +140,6 @@ struct ForceModel<PMB, Elastic, NoFracture, TemperatureDependent,
: base_type( _delta, _K )
, base_temperature_type( _temp, _alpha, _temp0 )
{
set_param( _delta, _K, _alpha, _temp0 );
}

void set_param( const double _delta, const double _K, const double _alpha,
const double _temp0 )
{
base_type::set_param( _delta, _K );
base_temperature_type::set_param( _alpha, _temp0 );
}
};

Expand Down Expand Up @@ -232,14 +197,6 @@ struct ForceModel<PMB, Elastic, Fracture, TemperatureDependent, TemperatureType>
: base_type( _delta, _K, _G0 )
, base_temperature_type( _temp, _alpha, _temp0 )
{
set_param( _delta, _K, _G0, _alpha, _temp0 );
}

void set_param( const double _delta, const double _K, const double _G0,
const double _alpha, const double _temp0 )
{
base_type::set_param( _delta, _K, _G0 );
base_temperature_type::set_param( _alpha, _temp0 );
}

KOKKOS_INLINE_FUNCTION
Expand Down Expand Up @@ -301,17 +258,6 @@ struct ForceModel<PMB, Elastic, NoFracture, DynamicTemperature, TemperatureType>
, base_temperature_type( _delta, _kappa, _cp,
_constant_microconductivity )
{
set_param( _delta, _K, _kappa, _cp, _alpha, _temp0,
_constant_microconductivity );
}

void set_param( const double _delta, const double _K, const double _kappa,
const double _cp, const double _alpha, const double _temp0,
const bool _constant_microconductivity )
{
base_type::set_param( _delta, _K, _alpha, _temp0 );
base_temperature_type::set_param( _delta, _kappa, _cp,
_constant_microconductivity );
}
};

Expand Down Expand Up @@ -364,20 +310,9 @@ struct ForceModel<PMB, Fracture, DynamicTemperature, TemperatureType>
const double _temp0 = 0.0,
const bool _constant_microconductivity = true )
: base_type( _delta, _K, _G0, _temp, _alpha, _temp0 )
, base_temperature_type( _delta, _kappa, _cp,
_constant_microconductivity )
{
set_param( _delta, _K, _G0, _kappa, _cp, _alpha, _temp0 );
base_temperature_type::set_param( _delta, _kappa, _cp,
_constant_microconductivity );
}

void set_param( const double _delta, const double _K, const double _G0,
const double _kappa, const double _cp, const double _alpha,
const double _temp0,
const bool _constant_microconductivity )
{
base_type::set_param( _delta, _K, _G0, _alpha, _temp0 );
base_temperature_type::set_param( _delta, _kappa, _cp,
_constant_microconductivity );
}
};

Expand Down
6 changes: 0 additions & 6 deletions src/force/CabanaPD_HertzianContact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ struct HertzianModel : public ContactModel
HertzianModel( const double _Rc, const double _radius, const double _nu,
const double _E, const double _e )
: ContactModel( 1.0, _Rc )
{
set_param( _radius, _nu, _E, _e );
}

void set_param( const double _radius, const double _nu, const double _E,
const double _e )
{
nu = _nu;
radius = _radius;
Expand Down

0 comments on commit e5973cd

Please sign in to comment.