Skip to content

Commit a8c3d22

Browse files
authored
Merge pull request #729 from sebproell/remove-invalid-template-qual
Remove INVALID_TEMPLATE_QUALIFIER
2 parents d476353 + 989289b commit a8c3d22

File tree

6 files changed

+27
-37
lines changed

6 files changed

+27
-37
lines changed

src/adapter/4C_adapter_str_structure_new.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -433,16 +433,15 @@ void Adapter::StructureBaseAlgorithmNew::set_model_types(
433433
case Core::ProblemType::ssi:
434434
case Core::ProblemType::ssti:
435435
{
436-
if (prbdyn_->INVALID_TEMPLATE_QUALIFIER
437-
isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>("Partitioned Coupling Model"))
436+
if (prbdyn_->isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
437+
"Partitioned Coupling Model"))
438438
{
439-
if (prbdyn_->INVALID_TEMPLATE_QUALIFIER
440-
isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
441-
"Monolithic Coupling Model"))
439+
if (prbdyn_->isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
440+
"Monolithic Coupling Model"))
442441
FOUR_C_THROW("Cannot have both partitioned and monolithic coupling at the same time!");
443442
const auto coupling_model_ptr =
444-
prbdyn_->INVALID_TEMPLATE_QUALIFIER
445-
get<std::shared_ptr<Solid::ModelEvaluator::Generic>>("Partitioned Coupling Model");
443+
prbdyn_->get<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
444+
"Partitioned Coupling Model");
446445
if (!coupling_model_ptr)
447446
FOUR_C_THROW("The partitioned coupling model pointer is not allowed to be nullptr!");
448447
// set the model type
@@ -452,13 +451,12 @@ void Adapter::StructureBaseAlgorithmNew::set_model_types(
452451
"Partitioned Coupling Model", coupling_model_ptr);
453452
}
454453

455-
else if (prbdyn_->INVALID_TEMPLATE_QUALIFIER
456-
isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
457-
"Monolithic Coupling Model"))
454+
else if (prbdyn_->isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
455+
"Monolithic Coupling Model"))
458456
{
459457
const auto coupling_model_ptr =
460-
prbdyn_->INVALID_TEMPLATE_QUALIFIER
461-
get<std::shared_ptr<Solid::ModelEvaluator::Generic>>("Monolithic Coupling Model");
458+
prbdyn_->get<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
459+
"Monolithic Coupling Model");
462460
if (!coupling_model_ptr)
463461
FOUR_C_THROW("The monolithic coupling model pointer is not allowed to be nullptr!");
464462
// set the model type
@@ -468,12 +466,11 @@ void Adapter::StructureBaseAlgorithmNew::set_model_types(
468466
"Monolithic Coupling Model", coupling_model_ptr);
469467
}
470468

471-
else if (prbdyn_->INVALID_TEMPLATE_QUALIFIER
472-
isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>("Basic Coupling Model"))
469+
else if (prbdyn_->isType<std::shared_ptr<Solid::ModelEvaluator::Generic>>(
470+
"Basic Coupling Model"))
473471
{
474472
const auto coupling_model_ptr =
475-
prbdyn_->INVALID_TEMPLATE_QUALIFIER
476-
get<std::shared_ptr<Solid::ModelEvaluator::Generic>>("Basic Coupling Model");
473+
prbdyn_->get<std::shared_ptr<Solid::ModelEvaluator::Generic>>("Basic Coupling Model");
477474
if (!coupling_model_ptr)
478475
FOUR_C_THROW("The basic coupling model pointer is not allowed to be nullptr!");
479476
// set the model type

src/scatra_ele/4C_scatra_ele_calc_lsreinit.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ void Discret::Elements::ScaTraEleCalcLsReinit<distype, prob_dim>::eval_reinitial
142142
Core::Geo::BoundaryIntCellPtrs boundaryIntCells = Core::Geo::BoundaryIntCellPtrs(0);
143143

144144
// check the type: ToDo change to FOUR_C_ASSERT
145-
if (not params.INVALID_TEMPLATE_QUALIFIER
146-
isType<std::shared_ptr<const std::map<int, Core::Geo::BoundaryIntCellPtrs>>>(
147-
"boundary cells"))
145+
if (not params.isType<std::shared_ptr<const std::map<int, Core::Geo::BoundaryIntCellPtrs>>>(
146+
"boundary cells"))
148147
FOUR_C_THROW("The given boundary cells have the wrong type!");
149148

150149
const std::shared_ptr<const std::map<int, Core::Geo::BoundaryIntCellPtrs>>& allcells =

src/solver_nonlin_nox/4C_solver_nonlin_nox_group_prepostoperator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ void NOX::Nln::GROUP::PrePostOperator::reset(Teuchos::ParameterList& groupOption
5151

5252
/* Check if a pre/post operator for the group is provided
5353
* by the user. */
54-
if (groupOptionsSubList.INVALID_TEMPLATE_QUALIFIER isType<Teuchos::RCP<Map>>(
55-
"User Defined Pre/Post Operator"))
54+
if (groupOptionsSubList.isType<Teuchos::RCP<Map>>("User Defined Pre/Post Operator"))
5655
{
57-
prePostOperatorMapPtr_ = groupOptionsSubList.INVALID_TEMPLATE_QUALIFIER get<Teuchos::RCP<Map>>(
58-
"User Defined Pre/Post Operator");
56+
prePostOperatorMapPtr_ =
57+
groupOptionsSubList.get<Teuchos::RCP<Map>>("User Defined Pre/Post Operator");
5958
havePrePostOperator_ = true;
6059
}
6160
}

src/solver_nonlin_nox/4C_solver_nonlin_nox_linearsystem_prepostoperator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ void NOX::Nln::LinSystem::PrePostOperator::reset(Teuchos::ParameterList& linearS
5151

5252
/* Check if a pre/post processor for the linear system is provided
5353
* by the user. */
54-
if (linearSolverSubList.INVALID_TEMPLATE_QUALIFIER isType<Teuchos::RCP<Map>>(
55-
"User Defined Pre/Post Operator"))
54+
if (linearSolverSubList.isType<Teuchos::RCP<Map>>("User Defined Pre/Post Operator"))
5655
{
57-
prePostOperatorMapPtr_ = linearSolverSubList.INVALID_TEMPLATE_QUALIFIER get<Teuchos::RCP<Map>>(
58-
"User Defined Pre/Post Operator");
56+
prePostOperatorMapPtr_ =
57+
linearSolverSubList.get<Teuchos::RCP<Map>>("User Defined Pre/Post Operator");
5958
havePrePostOperator_ = true;
6059
}
6160
}

src/solver_nonlin_nox/4C_solver_nonlin_nox_linesearch_prepostoperator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ void NOX::Nln::LineSearch::PrePostOperator::reset(Teuchos::ParameterList& linese
2626

2727
/* Check if a pre/post operator for linesearch is provided
2828
* by the user. */
29-
if (linesearchSublist.INVALID_TEMPLATE_QUALIFIER isType<Teuchos::RCP<map>>(
30-
"User Defined Pre/Post Operator"))
29+
if (linesearchSublist.isType<Teuchos::RCP<map>>("User Defined Pre/Post Operator"))
3130
{
32-
prePostOperatorMapPtr_ = linesearchSublist.INVALID_TEMPLATE_QUALIFIER get<Teuchos::RCP<map>>(
33-
"User Defined Pre/Post Operator");
31+
prePostOperatorMapPtr_ =
32+
linesearchSublist.get<Teuchos::RCP<map>>("User Defined Pre/Post Operator");
3433
havePrePostOperator_ = true;
3534
}
3635
}

src/structure_new/src/model_evaluator/4C_structure_new_model_evaluator_structure.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,7 @@ void Solid::ModelEvaluator::Structure::evaluate_internal(Teuchos::ParameterList&
13011301
"Please use the Solid::Elements::Interface and its derived "
13021302
"classes to set and get parameters.");
13031303
}
1304-
if (not p.INVALID_TEMPLATE_QUALIFIER isType<std::shared_ptr<Core::Elements::ParamsInterface>>(
1305-
"interface"))
1304+
if (not p.isType<std::shared_ptr<Core::Elements::ParamsInterface>>("interface"))
13061305
FOUR_C_THROW("The given parameter has the wrong type!");
13071306

13081307
// FixMe as soon as possible: write data to the parameter list.
@@ -1339,8 +1338,7 @@ void Solid::ModelEvaluator::Structure::evaluate_internal_specified_elements(
13391338
"Please use the Solid::Elements::Interface and its derived "
13401339
"classes to set and get parameters.");
13411340
}
1342-
if (not p.INVALID_TEMPLATE_QUALIFIER isType<std::shared_ptr<Core::Elements::ParamsInterface>>(
1343-
"interface"))
1341+
if (not p.isType<std::shared_ptr<Core::Elements::ParamsInterface>>("interface"))
13441342
FOUR_C_THROW("The given parameter has the wrong type!");
13451343

13461344
// write data to the parameter list.
@@ -1374,8 +1372,7 @@ void Solid::ModelEvaluator::Structure::evaluate_neumann(Teuchos::ParameterList&
13741372
"Please use the Solid::Elements::Interface and its derived "
13751373
"classes to set and get parameters.");
13761374
}
1377-
if (not p.INVALID_TEMPLATE_QUALIFIER isType<std::shared_ptr<Core::Elements::ParamsInterface>>(
1378-
"interface"))
1375+
if (not p.isType<std::shared_ptr<Core::Elements::ParamsInterface>>("interface"))
13791376
FOUR_C_THROW("The given parameter has the wrong type!");
13801377
discret().evaluate_neumann(p, eval_vec, eval_mat.get());
13811378
discret().clear_state();

0 commit comments

Comments
 (0)