1515#include " 4C_linalg_vector.hpp"
1616#include " 4C_ssi_str_model_evaluator_base.hpp"
1717
18+ #include < utility>
19+
1820FOUR_C_NAMESPACE_OPEN
1921
2022// forward declarations
@@ -73,7 +75,7 @@ namespace SSI
7375
7476 // ! return counter for Newton-Raphson iterations (monolithic algorithm) or outer coupling
7577 // ! iterations (partitioned algorithm)
76- int iteration_count () const { return iter_; }
78+ [[nodiscard]] int iteration_count () const { return iter_; }
7779
7880 // ! reset the counter for Newton-Raphson iterations (monolithic algorithm) or outer coupling
7981 // ! iterations (partitioned algorithm)
@@ -106,7 +108,7 @@ namespace SSI
106108 */
107109 virtual void init (MPI_Comm comm, const Teuchos::ParameterList& globaltimeparams,
108110 const Teuchos::ParameterList& scatraparams, const Teuchos::ParameterList& structparams,
109- const std::string& struct_disname, const std::string& scatra_disname, bool isAle ) = 0;
111+ const std::string& struct_disname, const std::string& scatra_disname, bool is_ale ) = 0;
110112
111113 /* ! \brief Setup all class internal objects and members
112114
@@ -132,19 +134,19 @@ namespace SSI
132134 * @brief Perform all necessary tasks after setting up the object.
133135 * Currently, this only calls the post_setup routine of the structure field.
134136 */
135- void post_setup ();
137+ void post_setup () const ;
136138
137139 // ! returns true if setup() was called and is still valid
138- bool is_setup () const { return issetup_; };
140+ [[nodiscard]] bool is_setup () const { return issetup_; }
139141
140142 /* !
141143 * @brief checks whether simulation is restarted or not
142144 *
143145 * @return flag indicating if simulation is restarted
144146 */
145- bool is_restart () const ;
147+ [[nodiscard]] bool is_restart () const ;
146148
147- [[nodiscard]] bool is_s2_i_kinetics_with_pseudo_contact () const
149+ [[nodiscard]] bool is_s2i_kinetics_with_pseudo_contact () const
148150 {
149151 return is_s2i_kinetic_with_pseudo_contact_;
150152 }
@@ -165,7 +167,7 @@ namespace SSI
165167
166168 */
167169 virtual void init_discretizations (MPI_Comm comm, const std::string& struct_disname,
168- const std::string& scatra_disname, const bool redistribute_struct_dis);
170+ const std::string& scatra_disname, bool redistribute_struct_dis);
169171
170172 // / setup
171173 virtual void setup_system ();
@@ -180,34 +182,36 @@ namespace SSI
180182 void read_restart (int restart) override ;
181183
182184 // ! access to structural field
183- const std::shared_ptr<Adapter::SSIStructureWrapper>& structure_field () const
185+ [[nodiscard]] std::shared_ptr<Adapter::SSIStructureWrapper> structure_field () const
184186 {
185187 return structure_;
186188 }
187189
188190 // / pointer to the underlying structure problem base algorithm
189- std::shared_ptr<Adapter::StructureBaseAlgorithmNew> structure_base_algorithm () const
191+ [[nodiscard]] std::shared_ptr<Adapter::StructureBaseAlgorithmNew> structure_base_algorithm ()
192+ const
190193 {
191194 return struct_adapterbase_ptr_;
192195 }
193196
194197 // ! access the scalar transport base algorithm
195- const std::shared_ptr<Adapter::ScaTraBaseAlgorithm>& scatra_base_algorithm () const
198+ [[nodiscard]] std::shared_ptr<Adapter::ScaTraBaseAlgorithm> scatra_base_algorithm () const
196199 {
197200 return scatra_base_algorithm_;
198201 }
199202
200203 // ! access the scalar transport base algorithm on manifolds
201- const std::shared_ptr<Adapter::ScaTraBaseAlgorithm>& scatra_manifold_base_algorithm () const
204+ [[nodiscard]] std::shared_ptr<Adapter::ScaTraBaseAlgorithm> scatra_manifold_base_algorithm ()
205+ const
202206 {
203207 return scatra_manifold_base_algorithm_;
204208 }
205209
206210 // ! access the scalar transport field
207- std::shared_ptr<ScaTra::ScaTraTimIntImpl> scatra_field () const ;
211+ [[nodiscard]] std::shared_ptr<ScaTra::ScaTraTimIntImpl> scatra_field () const ;
208212
209213 // ! access the scalar transport field on manifolds
210- std::shared_ptr<ScaTra::ScaTraTimIntImpl> scatra_manifold () const ;
214+ [[nodiscard]] std::shared_ptr<ScaTra::ScaTraTimIntImpl> scatra_manifold () const ;
211215
212216 // / set structure solution on other fields
213217 void set_struct_solution (std::shared_ptr<const Core::LinAlg::Vector<double >> disp,
@@ -231,50 +235,50 @@ namespace SSI
231235 void evaluate_and_set_temperature_field ();
232236
233237 // ! get bool indicating if we have at least one ssi interface meshtying condition
234- bool ssi_interface_meshtying () const { return ssiinterfacemeshtying_ ; }
238+ [[nodiscard]] bool ssi_interface_meshtying () const { return ssi_interface_meshtying_ ; }
235239
236240 // ! return the scatra-scatra interface meshtying strategy
237- std::shared_ptr<const ScaTra::MeshtyingStrategyS2I> meshtying_strategy_s2_i () const
241+ [[nodiscard]] std::shared_ptr<const ScaTra::MeshtyingStrategyS2I> meshtying_strategy_s2i () const
238242 {
239243 return meshtying_strategy_s2i_;
240244 }
241245
242246 // ! returns whether calculation of the initial potential field is performed
243- bool do_calculate_initial_potential_field () const ;
247+ [[nodiscard]] bool do_calculate_initial_potential_field () const ;
244248
245249 // ! returns if the scalar transport time integration is of type electrochemistry
246- bool is_elch_scatra_tim_int_type () const ;
250+ [[nodiscard]] bool is_elch_scatra_time_int_type () const ;
247251
248252 // ! solve additional scatra field on manifolds
249- bool is_scatra_manifold () const { return is_scatra_manifold_; }
253+ [[nodiscard]] bool is_scatra_manifold () const { return is_scatra_manifold_; }
250254
251255 // ! activate mesh tying between overlapping manifold fields
252- bool is_scatra_manifold_meshtying () const { return is_manifold_meshtying_; }
256+ [[nodiscard]] bool is_scatra_manifold_meshtying () const { return is_manifold_meshtying_; }
253257
254258 // ! Redistribute nodes and elements on processors
255259 void redistribute (RedistributionType redistribution_type);
256260
257261 // ! get bool indicating if we have at least one ssi interface contact condition
258- bool ssi_interface_contact () const { return ssiinterfacecontact_ ; }
262+ [[nodiscard]] bool ssi_interface_contact () const { return ssi_interface_contact_ ; }
259263
260264 // ! set up a pointer to the contact strategy of the structural field and store it
261265 void setup_contact_strategy ();
262266
263267 // ! SSI structure meshtying object containing coupling adapters, converters and maps
264- std::shared_ptr<SSI:: Utils::SSIMeshTying> ssi_structure_mesh_tying () const
268+ [[nodiscard]] std::shared_ptr<Utils::SSIMeshTying> ssi_structure_mesh_tying () const
265269 {
266270 return ssi_structure_meshtying_;
267271 }
268272
269273 // ! return contact nitsche strategy for ssi problems
270- std::shared_ptr<CONTACT::NitscheStrategySsi> nitsche_strategy_ssi () const
274+ [[nodiscard]] std::shared_ptr<CONTACT::NitscheStrategySsi> nitsche_strategy_ssi () const
271275 {
272276 return contact_strategy_nitsche_;
273277 }
274278
275279 protected:
276280 // ! get bool indicating if old structural time integration is used
277- bool use_old_structure_time_int () const { return use_old_structure_; }
281+ [[nodiscard]] bool use_old_structure_time_int () const { return use_old_structure_; }
278282
279283 // ! check if \ref setup() was called
280284 void check_is_setup () const
@@ -304,7 +308,7 @@ namespace SSI
304308 void set_modelevaluator_base_ssi (
305309 std::shared_ptr<Solid::ModelEvaluator::Generic> modelevaluator_ssi_base)
306310 {
307- modelevaluator_ssi_base_ = modelevaluator_ssi_base;
311+ modelevaluator_ssi_base_ = std::move ( modelevaluator_ssi_base) ;
308312 }
309313
310314 // ! set flag true after setup or false if setup became invalid
@@ -317,10 +321,10 @@ namespace SSI
317321 virtual void setup_model_evaluator ();
318322
319323 // ! macro-micro scatra problem?
320- bool macro_scale () const { return macro_scale_; }
324+ [[nodiscard]] bool macro_scale () const { return macro_scale_; }
321325
322326 // ! different time step size between scatra field and structure field
323- bool diff_time_step_size () const { return diff_time_step_size_; }
327+ [[nodiscard]] bool diff_time_step_size () const { return diff_time_step_size_; }
324328
325329 // ! store contact nitsche strategy for ssi problems
326330 std::shared_ptr<CONTACT::NitscheStrategySsi> contact_strategy_nitsche_;
@@ -344,19 +348,19 @@ namespace SSI
344348 * @param[in] structparams parameter list containing the STRUCTURAL DYNAMIC parameters
345349 * @param[in] struct_disname name of structure discretization
346350 * @param[in] scatra_disname name of scalar transport discretization
347- * @param[in] isAle flag indicating if ALE is activated
351+ * @param[in] is_ale flag indicating if ALE is activated
348352 */
349353 void init_time_integrators (const Teuchos::ParameterList& globaltimeparams,
350354 const Teuchos::ParameterList& scatraparams, const Teuchos::ParameterList& structparams,
351- const std::string& struct_disname, const std::string& scatra_disname, const bool isAle );
355+ const std::string& struct_disname, const std::string& scatra_disname, bool is_ale );
352356
353357 /* !
354358 * @brief check whether pseudo contact is activated for at least one of the s2i kinetics
355359 * conditions
356360 *
357361 * @param[in] struct_disname name of structure discretization
358362 */
359- [[nodiscard]] bool check_s2_i_kinetics_condition_for_pseudo_contact (
363+ [[nodiscard]] bool check_s2i_kinetics_condition_for_pseudo_contact (
360364 const std::string& struct_disname) const ;
361365
362366 // ! check whether scatra-structure interaction flags are set correctly
@@ -370,7 +374,7 @@ namespace SSI
370374 void check_ssi_interface_conditions (const std::string& struct_disname) const ;
371375
372376 // ! returns true if init(..) was called and is still valid
373- bool is_init () const { return isinit_; }
377+ [[nodiscard]] bool is_init () const { return isinit_; }
374378
375379 // / set structure mesh displacement on scatra field
376380 void set_mesh_disp (std::shared_ptr<const Core::LinAlg::Vector<double >> disp);
@@ -419,16 +423,16 @@ namespace SSI
419423 std::shared_ptr<Adapter::ScaTraBaseAlgorithm> scatra_manifold_base_algorithm_;
420424
421425 // ! SSI structure mesh tying object containing coupling adapters, converters and maps
422- std::shared_ptr<SSI:: Utils::SSIMeshTying> ssi_structure_meshtying_;
426+ std::shared_ptr<Utils::SSIMeshTying> ssi_structure_meshtying_;
423427
424428 // / helper class for applying SSI couplings
425429 std::shared_ptr<SSICouplingBase> ssicoupling_;
426430
427431 // ! bool indicating if we have at least one ssi interface contact condition
428- const bool ssiinterfacecontact_ ;
432+ const bool ssi_interface_contact_ ;
429433
430434 // ! bool indicating if we have at least one ssi interface meshtying condition
431- const bool ssiinterfacemeshtying_ ;
435+ const bool ssi_interface_meshtying_ ;
432436
433437 // / ptr to underlying structure
434438 std::shared_ptr<Adapter::SSIStructureWrapper> structure_;
0 commit comments