@@ -1068,7 +1068,7 @@ void BeamInteraction::BeamToBeamPotentialPair<numnodes, numnodalvalues, T>::
10681068 }
10691069
10701070 if (params ()->strategy () == BeamPotential::Strategy::single_length_specific_small_separations &&
1071- params ()->potential_reduction_length () != - 1.0 )
1071+ params ()->potential_reduction_length (). has_value () )
10721072 {
10731073 FOUR_C_THROW (
10741074 " The potential reduction strategy is currently not implemented for the beam interaction "
@@ -1084,20 +1084,20 @@ void BeamInteraction::BeamToBeamPotentialPair<numnodes, numnodalvalues, T>::
10841084 const std::optional<double > cutoff_radius = params ()->cutoff_radius ();
10851085
10861086 // get potential reduction length
1087- const double potential_reduction_length = params ()->potential_reduction_length ();
1087+ const std::optional< double > potential_reduction_length = params ()->potential_reduction_length ();
10881088
10891089 // get length from current master beam element to beam edge
10901090 double length_prior_left = 0.0 ;
10911091 double length_prior_right = 0.0 ;
10921092
1093- if (potential_reduction_length > 0.0 )
1093+ if (potential_reduction_length. has_value () )
10941094 {
10951095 std::tie (length_prior_left, length_prior_right) =
10961096 params ()->ele_gid_prior_length_map_ .at (element2 ()->id ());
10971097
10981098 if ((length_prior_left >= 0.0 ) && (length_prior_right >= 0.0 ) &&
1099- ((ele2length_ - 2 * potential_reduction_length + length_prior_left + length_prior_right) <
1100- 0.0 ))
1099+ ((ele2length_ - 2 * potential_reduction_length. value () + length_prior_left +
1100+ length_prior_right) < 0.0 ))
11011101 {
11021102 FOUR_C_THROW (
11031103 " ERROR: Master beam endpoint reduction strategy would interfere on current master beam "
@@ -3029,8 +3029,8 @@ bool BeamInteraction::BeamToBeamPotentialPair<numnodes, numnodalvalues,
30293029 Core::LinAlg::Matrix<1 , 3 , T> const & xi_master_partial_r_slave,
30303030 Core::LinAlg::Matrix<1 , 3 , T> const & xi_master_partial_r_master,
30313031 Core::LinAlg::Matrix<1 , 3 , T> const & xi_master_partial_r_xi_master,
3032- double potential_reduction_length, double length_prior_right, double length_prior_left ,
3033- T& interaction_potential_GP,
3032+ std::optional< double > potential_reduction_length, double length_prior_right,
3033+ double length_prior_left, T& interaction_potential_GP,
30343034 Core::LinAlg::Matrix<1 , numnodes * numnodalvalues, double > const & N_i_slave,
30353035 Core::LinAlg::Matrix<1 , numnodes * numnodalvalues, double > const & N_i_xi_slave,
30363036 Core::LinAlg::Matrix<1 , numnodes * numnodalvalues, T> const & N_i_master,
@@ -3227,35 +3227,37 @@ bool BeamInteraction::BeamToBeamPotentialPair<numnodes, numnodalvalues,
32273227 }
32283228
32293229 // determine potential reduction factor for master beam endpoint strategy
3230- if (potential_reduction_length > 0.0 )
3230+ if (potential_reduction_length. has_value () )
32313231 {
32323232 T left_length_to_edge = length_prior_left + ele2length_ * 0.5 * (1 + xi_master);
32333233 T right_length_to_edge = length_prior_right + ele2length_ * 0.5 * (1 - xi_master);
32343234 T length_to_edge = -1.0 ;
32353235 bool right_node = false ;
32363236
32373237 // determine potential reduction factor (master beam can only consist of one element!)
3238- if (left_length_to_edge < potential_reduction_length)
3238+ if (left_length_to_edge < potential_reduction_length. value () )
32393239 {
32403240 potential_reduction_factor_GP =
3241- 0.5 - 0.5 * std::cos (M_PI * left_length_to_edge / potential_reduction_length);
3241+ 0.5 - 0.5 * std::cos (M_PI * left_length_to_edge / potential_reduction_length. value () );
32423242 length_to_edge = left_length_to_edge;
32433243 }
3244- else if (right_length_to_edge < potential_reduction_length)
3244+ else if (right_length_to_edge < potential_reduction_length. value () )
32453245 {
32463246 potential_reduction_factor_GP =
3247- 0.5 - 0.5 * std::cos (M_PI * right_length_to_edge / potential_reduction_length);
3247+ 0.5 - 0.5 * std::cos (M_PI * right_length_to_edge / potential_reduction_length. value () );
32483248 length_to_edge = right_length_to_edge;
32493249 right_node = true ;
32503250 }
32513251
3252- if ((length_to_edge < potential_reduction_length) && (length_to_edge != -1.0 ))
3252+ if ((length_to_edge < potential_reduction_length. value () ) && (length_to_edge != -1.0 ))
32533253 {
3254- pot_red_fac_deriv_l_edge = 0.5 * M_PI / potential_reduction_length *
3255- std::sin (M_PI * length_to_edge / potential_reduction_length);
3256- pot_red_fac_2ndderiv_l_edge = 0.5 * M_PI * M_PI /
3257- (potential_reduction_length * potential_reduction_length) *
3258- std::cos (M_PI * length_to_edge / potential_reduction_length);
3254+ pot_red_fac_deriv_l_edge =
3255+ 0.5 * M_PI / potential_reduction_length.value () *
3256+ std::sin (M_PI * length_to_edge / potential_reduction_length.value ());
3257+ pot_red_fac_2ndderiv_l_edge =
3258+ 0.5 * M_PI * M_PI /
3259+ (potential_reduction_length.value () * potential_reduction_length.value ()) *
3260+ std::cos (M_PI * length_to_edge / potential_reduction_length.value ());
32593261 }
32603262
32613263 l_edge_deriv_xi_master = 0.5 * ele2length_;
0 commit comments