Skip to content

Commit ae65466

Browse files
committed
Move setting of pressures
to dedicated method and use const reference instead of shared pointer
1 parent 28d5d02 commit ae65466

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/fs3i/4C_fs3i_fps3i_partitioned.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ void FS3I::PartFPS3I::set_pressure_fields()
685685
for (unsigned i = 0; i < scatravec_.size(); ++i)
686686
{
687687
std::shared_ptr<Adapter::ScaTraBaseAlgorithm> scatra = scatravec_[i];
688-
scatra->scatra_field()->set_pressure_field(pressure[i]);
688+
scatra->scatra_field()->set_pressure_field(*pressure[i]);
689689
}
690690
}
691691

src/scatra/4C_scatra_timint_implicit.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,22 +1391,18 @@ void ScaTra::ScaTraTimIntImpl::set_old_part_of_righthandside()
13911391
/*----------------------------------------------------------------------*
13921392
*----------------------------------------------------------------------*/
13931393
void ScaTra::ScaTraTimIntImpl::set_pressure_field(
1394-
std::shared_ptr<const Core::LinAlg::Vector<double>> pressure)
1394+
const Core::LinAlg::Vector<double>& pressure) const
13951395
{
1396-
if (pressure == nullptr) FOUR_C_THROW("Pressure state is nullptr");
1397-
1398-
#ifdef FOUR_C_ENABLE_ASSERTIONS
13991396
// We rely on the fact, that the nodal distribution of both fields is the same.
14001397
// Although Scatra discretization was constructed as a clone of the fluid or
14011398
// structure mesh, respectively, at the beginning, the nodal distribution may
14021399
// have changed meanwhile (e.g., due to periodic boundary conditions applied only
14031400
// to the fluid field)!
14041401
// We have to be sure that everything is still matching.
1405-
if (not pressure->get_map().SameAs(*discret_->dof_row_map(nds_pressure())))
1406-
FOUR_C_THROW("Maps are NOT identical. Emergency!");
1407-
#endif
1402+
FOUR_C_ASSERT(pressure.get_map().SameAs(*discret_->dof_row_map(nds_pressure())),
1403+
"Maps are NOT identical. Emergency!");
14081404

1409-
discret_->set_state(nds_pressure(), "Pressure", *pressure);
1405+
discret_->set_state(nds_pressure(), "Pressure", pressure);
14101406
}
14111407

14121408
/*----------------------------------------------------------------------*

src/scatra/4C_scatra_timint_implicit.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ namespace ScaTra
262262
//! set the @wall_shear_stress vector to the scalar transport discretization
263263
void set_wall_shear_stresses(const Core::LinAlg::Vector<double>& wall_shear_stress) const;
264264

265-
void set_pressure_field(std::shared_ptr<const Core::LinAlg::Vector<double>> pressure);
265+
//! set the @pressure vector to the scalar transport discretization
266+
void set_pressure_field(const Core::LinAlg::Vector<double>& pressure) const;
266267

267268
void set_membrane_concentration(
268269
std::shared_ptr<const Core::LinAlg::Vector<double>> MembraneConc);

0 commit comments

Comments
 (0)