Commit 5e625d2d authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1664 Add missing stuff (initial values, noexcept keywords, asserts)

parent d644abac
Pipeline #314729 failed with stages
in 46 minutes and 58 seconds
......@@ -21,13 +21,10 @@
// ============================
// End of forward declarations.
//! \endcond IGNORE_BLOCK_IN_DOXYGEN
// clang-format on
// clang-format off
// ============================
namespace MoReFEM
{
class NumberingSubset;
}
namespace MoReFEM { class NumberingSubset; }
// ============================
// End of forward declarations.
......
......@@ -115,7 +115,6 @@ namespace MoReFEM
//! \copydoc doxygen_hide_model_SupplHasFinishedConditions_always_true
bool SupplHasFinishedConditions() const;
/*!
* \brief Part of InitializedStep() specific to Elastic model.
*
......@@ -125,17 +124,17 @@ namespace MoReFEM
private:
//! Non constant access to the underlying VariationalFormulation object.
VariationalFormulation& GetNonCstVariationalFormulation();
VariationalFormulation& GetNonCstVariationalFormulation() noexcept;
//! Access to the underlying VariationalFormulation object.
const VariationalFormulation& GetVariationalFormulation() const;
const VariationalFormulation& GetVariationalFormulation() const noexcept;
///@}
private:
//! Underlying variational formulation.
VariationalFormulation::unique_ptr variational_formulation_;
VariationalFormulation::unique_ptr variational_formulation_ = nullptr;
};
......
......@@ -35,14 +35,14 @@ namespace MoReFEM
}
inline const VariationalFormulation& Model::GetVariationalFormulation() const
inline const VariationalFormulation& Model::GetVariationalFormulation() const noexcept
{
assert(!(!variational_formulation_));
return *variational_formulation_;
}
inline VariationalFormulation& Model::GetNonCstVariationalFormulation()
inline VariationalFormulation& Model::GetNonCstVariationalFormulation() noexcept
{
return const_cast<VariationalFormulation&>(GetVariationalFormulation());
}
......
......@@ -43,7 +43,7 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS::TyingPointsNS
const auto Ngeometric_coords = ref_geo_elt.Ncoords();
const auto ref_felt_space_dimension = basic_ref_felt.GetTopologyDimension();
const auto euclidean_dimension = 3ul;
constexpr auto euclidean_dimension = 3ul;
assert(ref_felt_space_dimension == euclidean_dimension
&& "This interpolation rule requires volumic elements.");
......@@ -53,13 +53,13 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS::TyingPointsNS
#endif // NDEBUG
matrix_parent::InitLocalMatrixStorage({ {
{ Nnode_test * 3, Nnode * 3 }, // helper_grad_grad
{ Nnode_test * 3, Nnode * 3 } // work_grad_grad
{ Nnode_test * 3ul, Nnode * 3ul }, // helper_grad_grad
{ Nnode_test * 3ul, Nnode * 3ul } // work_grad_grad
} });
// Symmetric interpolation for r and s components.
constexpr std::size_t Ntying_zz = 4;
constexpr std::size_t Ntying_rz = 2;
constexpr std::size_t Ntying_zz = 4ul;
constexpr std::size_t Ntying_rz = 2ul;
std::array<std::vector<double>, Ntying_zz> tying_points_coords_zz;
std::array<std::vector<double>, Ntying_rz> tying_points_coords_rz;
......@@ -113,6 +113,7 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS::TyingPointsNS
helper_grad_grad,
work_grad_grad);
assert(EnumUnderlyingType(tying_pt_interpolation_component::e_zz) < data_array.size());
data_array[EnumUnderlyingType(tying_pt_interpolation_component::e_zz)] =
std::make_unique<TyingPointDataForComponent>(
ret_shape_function, dphi_geo_list, dphi_felt_list, dphi_test_felt_list, work_grad_grad);
......@@ -295,7 +296,10 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS::TyingPointsNS
{
std::vector<double> ret{
(r - 1.) * (s - 1.) / 4., -(r + 1.) * (s - 1.) / 4., (r + 1.) * (s + 1.) / 4., -(r - 1.) * (s + 1.) / 4.
(r - 1.) * (s - 1.) * .25,
-(r + 1.) * (s - 1.) * .25,
(r + 1.) * (s + 1.) * .25,
-(r - 1.) * (s + 1.) * .25
};
return ret;
}
......@@ -304,7 +308,9 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS::TyingPointsNS
const std::vector<double> MITC4::TyingPointShapeFunctionRZ(const double r, const double s)
{
static_cast<void>(r);
std::vector<double> ret{ (1. - s) / 2., (1. + s) / 2. };
std::vector<double> ret{
(1. - s) * .5,
(1. + s) * .5 };
return ret;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment