Skip to content

Commit 28d5d02

Browse files
committed
Move setting of wall shear stresses
to dedicated method and use const reference instead of shared pointer
1 parent 25c3b36 commit 28d5d02

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

src/fs3i/4C_fs3i_fps3i_partitioned.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ void FS3I::PartFPS3I::set_wall_shear_stresses()
670670
for (unsigned i = 0; i < scatravec_.size(); ++i)
671671
{
672672
std::shared_ptr<Adapter::ScaTraBaseAlgorithm> scatra = scatravec_[i];
673-
scatra->scatra_field()->set_wall_shear_stresses(wss[i]);
673+
scatra->scatra_field()->set_wall_shear_stresses(*wss[i]);
674674
}
675675
}
676676

src/fs3i/4C_fs3i_partitioned.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ void FS3I::PartFS3I::set_wall_shear_stresses() const
762762
for (unsigned i = 0; i < scatravec_.size(); ++i)
763763
{
764764
std::shared_ptr<Adapter::ScaTraBaseAlgorithm> scatra = scatravec_[i];
765-
scatra->scatra_field()->set_wall_shear_stresses(vol_mortar_master_to_slavei(i, wss[i]));
765+
scatra->scatra_field()->set_wall_shear_stresses(*vol_mortar_master_to_slavei(i, wss[i]));
766766
}
767767
}
768768

src/scatra/4C_scatra_timint_implicit.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,22 +1366,18 @@ void ScaTra::ScaTraTimIntImpl::set_external_force() const
13661366
/*----------------------------------------------------------------------*
13671367
*----------------------------------------------------------------------*/
13681368
void ScaTra::ScaTraTimIntImpl::set_wall_shear_stresses(
1369-
std::shared_ptr<const Core::LinAlg::Vector<double>> wss)
1369+
const Core::LinAlg::Vector<double>& wall_shear_stress) const
13701370
{
1371-
if (wss == nullptr) FOUR_C_THROW("WSS state is nullptr");
1372-
1373-
#ifdef FOUR_C_ENABLE_ASSERTIONS
13741371
// We rely on the fact, that the nodal distribution of both fields is the same.
13751372
// Although Scatra discretization was constructed as a clone of the fluid or
13761373
// structure mesh, respectively, at the beginning, the nodal distribution may
13771374
// have changed meanwhile (e.g., due to periodic boundary conditions applied only
13781375
// to the fluid field)!
13791376
// We have to be sure that everything is still matching.
1380-
if (not wss->get_map().SameAs(*discret_->dof_row_map(nds_wall_shear_stress())))
1381-
FOUR_C_THROW("Maps are NOT identical. Emergency!");
1382-
#endif
1377+
FOUR_C_ASSERT(wall_shear_stress.get_map().SameAs(*discret_->dof_row_map(nds_wall_shear_stress())),
1378+
"Maps are NOT identical. Emergency!");
13831379

1384-
discret_->set_state(nds_wall_shear_stress(), "WallShearStress", *wss);
1380+
discret_->set_state(nds_wall_shear_stress(), "WallShearStress", wall_shear_stress);
13851381
}
13861382

13871383
/*----------------------------------------------------------------------*

src/scatra/4C_scatra_timint_implicit.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ namespace ScaTra
259259
//! set the @velocity vector to the scalar transport discretization
260260
void set_velocity_field(const Core::LinAlg::Vector<double>& velocity);
261261

262-
void set_wall_shear_stresses(std::shared_ptr<const Core::LinAlg::Vector<double>> wss);
262+
//! set the @wall_shear_stress vector to the scalar transport discretization
263+
void set_wall_shear_stresses(const Core::LinAlg::Vector<double>& wall_shear_stress) const;
263264

264265
void set_pressure_field(std::shared_ptr<const Core::LinAlg::Vector<double>> pressure);
265266

0 commit comments

Comments
 (0)