Skip to content

Commit 9f6caad

Browse files
Merge pull request #546 from davidrudlstorfer/rework_potential_input
Rework potential input
2 parents c899f3f + f7da499 commit 9f6caad

File tree

27 files changed

+205
-273
lines changed

27 files changed

+205
-273
lines changed

src/beamcontact/4C_beamcontact_beam3contact_manager.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,14 @@ CONTACT::Beam3cmanager::Beam3cmanager(Core::FE::Discretization& discret, double
315315
{
316316
std::cout << "=============== Beam Potential-Based Interaction ===============" << std::endl;
317317

318-
switch (Teuchos::getIntegralValue<BeamPotential::BeamPotentialType>(
319-
sbeampotential_, "BEAMPOTENTIAL_TYPE"))
318+
switch (Teuchos::getIntegralValue<BeamPotential::Type>(sbeampotential_, "TYPE"))
320319
{
321-
case BeamPotential::beampot_surf:
320+
case BeamPotential::Type::surface:
322321
{
323322
std::cout << "Potential Type: Surface" << std::endl;
324323
break;
325324
}
326-
case BeamPotential::beampot_vol:
325+
case BeamPotential::Type::volume:
327326
{
328327
std::cout << "Potential Type: Volume" << std::endl;
329328
break;

src/beaminteraction/src/potential/4C_beaminteraction_potential_input.cpp

Lines changed: 22 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -24,54 +24,36 @@ void BeamPotential::set_valid_parameters(std::map<std::string, Core::IO::InputSp
2424
/* parameters for potential-based beam interaction */
2525
Core::Utils::SectionSpecs beampotential{"BEAM POTENTIAL"};
2626

27+
// TODO change to vector and remove default value
2728
beampotential.specs.emplace_back(parameter<std::string>(
2829
"POT_LAW_EXPONENT", {.description = "negative(!) exponent(s) $m_i$ of potential law "
2930
"$\\Phi(r) = \\sum_i (k_i * r^{-m_i}).$",
3031
.default_value = "1.0"}));
3132

33+
// TODO change to vector and remove default value
3234
beampotential.specs.emplace_back(parameter<std::string>("POT_LAW_PREFACTOR",
3335
{.description = "prefactor(s) $k_i$ of potential law $\\Phi(r) = \\sum_i (k_i * r^{-m_i})$.",
3436
.default_value = "0.0"}));
3537

36-
beampotential.specs.emplace_back(
37-
deprecated_selection<BeamPotential::BeamPotentialType>("BEAMPOTENTIAL_TYPE",
38-
{
39-
{"Surface", beampot_surf},
40-
{"surface", beampot_surf},
41-
{"Volume", beampot_vol},
42-
{"volume", beampot_vol},
43-
},
44-
{.description = "Type of potential interaction: surface (default) or volume potential",
45-
.default_value = beampot_surf}));
46-
47-
beampotential.specs.emplace_back(
48-
deprecated_selection<BeamPotential::BeamPotentialStrategy>("STRATEGY",
49-
{
50-
{"DoubleLengthSpecific_LargeSepApprox", strategy_doublelengthspec_largesepapprox},
51-
{"DoubleLengthSpecific_SmallSepApprox", strategy_doublelengthspec_smallsepapprox},
52-
{"SingleLengthSpecific_SmallSepApprox", strategy_singlelengthspec_smallsepapprox},
53-
{"SingleLengthSpecific_SmallSepApprox_Simple",
54-
strategy_singlelengthspec_smallsepapprox_simple},
55-
},
56-
{.description = "strategy to evaluate interaction potential: double/single length "
57-
"specific, small/large separation approximation, ...",
58-
.default_value = strategy_doublelengthspec_largesepapprox}));
59-
60-
beampotential.specs.emplace_back(parameter<double>("CUTOFF_RADIUS",
38+
// TODO remove default value
39+
beampotential.specs.emplace_back(parameter<BeamPotential::Type>("TYPE",
40+
{.description = "Type of potential interaction: surface (default) or volume potential",
41+
.default_value = BeamPotential::Type::surface}));
42+
43+
// TODO remove default value
44+
beampotential.specs.emplace_back(parameter<BeamPotential::Strategy>("STRATEGY",
45+
{.description = "strategy to evaluate interaction potential: double/single length specific, "
46+
"small/large separation approximation, ...",
47+
.default_value = BeamPotential::Strategy::double_length_specific_large_separations}));
48+
49+
beampotential.specs.emplace_back(parameter<std::optional<double>>("CUTOFF_RADIUS",
6150
{.description =
62-
"Neglect all potential contributions at separation largerthan this cutoff radius",
63-
.default_value = -1.0}));
51+
"Neglect all potential contributions at separation largerthan this cutoff radius"}));
6452

65-
beampotential.specs.emplace_back(
66-
deprecated_selection<BeamPotential::BeamPotentialRegularizationType>("REGULARIZATION_TYPE",
67-
{
68-
{"linear_extrapolation", regularization_linear},
69-
{"constant_extrapolation", regularization_constant},
70-
{"None", regularization_none},
71-
{"none", regularization_none},
72-
},
73-
{.description = "Type of regularization applied to the force law",
74-
.default_value = regularization_none}));
53+
// TODO subgroup regularization
54+
beampotential.specs.emplace_back(parameter<BeamPotential::RegularizationType>(
55+
"REGULARIZATION_TYPE", {.description = "Type of regularization applied to the force law",
56+
.default_value = BeamPotential::RegularizationType::none}));
7557

7658
beampotential.specs.emplace_back(parameter<double>("REGULARIZATION_SEPARATION",
7759
{.description = "Use regularization of force law at separations smaller than this separation",
@@ -91,37 +73,10 @@ void BeamPotential::set_valid_parameters(std::map<std::string, Core::IO::InputSp
9173
"slave be assigned to beam elements?",
9274
.default_value = MasterSlaveChoice::smaller_eleGID_is_slave}));
9375

94-
beampotential.specs.emplace_back(parameter<bool>("BEAMPOT_BTSOL",
76+
beampotential.specs.emplace_back(parameter<std::optional<double>>("POTENTIAL_REDUCTION_LENGTH",
9577
{.description =
96-
"decide, whether potential-based interaction between beams and solids is considered",
97-
.default_value = false}));
98-
99-
beampotential.specs.emplace_back(parameter<bool>("BEAMPOT_BTSPH",
100-
{.description =
101-
"decide, whether potential-based interaction between beams and spheres is considered",
102-
.default_value = false}));
103-
104-
// enable octree search and determine type of bounding box (aabb = axis aligned, spbb = spherical)
105-
beampotential.specs.emplace_back(deprecated_selection<BeamContact::OctreeType>("BEAMPOT_OCTREE",
106-
{
107-
{"None", BeamContact::boct_none},
108-
{"none", BeamContact::boct_none},
109-
{"octree_axisaligned", BeamContact::boct_aabb},
110-
{"octree_cylorient", BeamContact::boct_cobb},
111-
{"octree_spherical", BeamContact::boct_spbb},
112-
},
113-
{.description = "octree and bounding box type for octree search routine",
114-
.default_value = BeamContact::boct_none}));
115-
116-
beampotential.specs.emplace_back(parameter<int>(
117-
"BEAMPOT_TREEDEPTH", {.description = "max. tree depth of the octree", .default_value = 6}));
118-
beampotential.specs.emplace_back(parameter<int>("BEAMPOT_BOXESINOCT",
119-
{.description = "max number of bounding boxes in any leaf octant", .default_value = 8}));
120-
121-
beampotential.specs.emplace_back(parameter<double>("POTENTIAL_REDUCTION_LENGTH",
122-
{.description = "Within this length of the master beam end point the potential is smoothly "
123-
"reduced to one half to account for infinitely long master beam surrogates.",
124-
.default_value = -1.0}));
78+
"Within this length of the master beam end point the potential is smoothly "
79+
"reduced to one half to account for infinitely long master beam surrogates."}));
12580

12681
beampotential.move_into_collection(list);
12782

src/beaminteraction/src/potential/4C_beaminteraction_potential_input.hpp

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,42 @@ namespace Core::Conditions
2626
namespace BeamPotential
2727
{
2828
/// type of potential interaction
29-
/// (this enum represents the input file parameter BEAMPOTENTIAL_TYPE)
30-
enum BeamPotentialType
29+
enum class Type
3130
{
32-
beampot_surf, ///< surface potential
33-
beampot_vol, ///< volume potential
34-
beampot_vague
31+
surface, ///< surface potential
32+
volume, ///< volume potential
33+
vague
3534
};
3635

3736
/// available strategies/methods to evaluate potential interaction
38-
/// (this enum represents the input file parameter STRATEGY)
39-
enum BeamPotentialStrategy
37+
enum class Strategy
4038
{
41-
strategy_doublelengthspec_largesepapprox, ///< double length specific potential, large
39+
double_length_specific_large_separations, ///< double length specific potential, large
4240
///< separations
43-
strategy_doublelengthspec_smallsepapprox, ///< double length specific potential, small
41+
double_length_specific_small_separations, ///< double length specific potential, small
4442
///< separations
45-
strategy_singlelengthspec_smallsepapprox, ///< single length specific potential, small
43+
single_length_specific_small_separations, ///< single length specific potential, small
4644
///< separations
47-
strategy_singlelengthspec_smallsepapprox_simple, ///< reduced variant of the previous one
48-
strategy_vague
45+
single_length_specific_small_separations_simple, ///< single length specific potential, small
46+
///< separations, reduced variant
47+
vague
4948
};
5049

51-
/// available types to regularize the force law for separations smaller than
52-
/// the specified regularization parameter
53-
enum BeamPotentialRegularizationType
50+
/// available types to regularize the force law for separations smaller than the specified
51+
/// regularization separation
52+
enum class RegularizationType
5453
{
55-
regularization_linear, ///< linear extrapolation
56-
regularization_constant, ///< constant extrapolation, i.e. f(r)=f(r_reg) for all r<r_reg
57-
regularization_none ///< no regularization
54+
linear, ///< linear extrapolation
55+
constant, ///< constant extrapolation, i.e. f(r)=f(r_reg) for all r<r_reg
56+
none ///< no regularization
5857
};
5958

60-
/**
61-
* \brief rule for how to assign the role of slave and master to beam elements
62-
*/
59+
/// rule for how to assign the role of slave and master to beam elements
6360
enum class MasterSlaveChoice
6461
{
6562
smaller_eleGID_is_slave,
6663
higher_eleGID_is_slave,
67-
choice_master_slave_vague
64+
vague
6865
};
6966

7067
/// set the beam potential parameters

0 commit comments

Comments
 (0)