diff --git a/Applications/FileIO/AsciiRasterInterface.cpp b/Applications/FileIO/AsciiRasterInterface.cpp index 2c54be6a105cb6ec6f8dee3142c38e4aa97c5f15..107c417c90f488ba2c16f24ab2485c7aac13a2e9 100644 --- a/Applications/FileIO/AsciiRasterInterface.cpp +++ b/Applications/FileIO/AsciiRasterInterface.cpp @@ -286,7 +286,7 @@ std::optional<std::vector<GeoLib::Raster const*>> readRasters( { if (!allRastersExist(raster_paths)) { - return boost::none; + return std::nullopt; } std::vector<GeoLib::Raster const*> rasters; @@ -295,6 +295,6 @@ std::optional<std::vector<GeoLib::Raster const*>> readRasters( std::back_inserter(rasters), [](auto const& path) { return FileIO::AsciiRasterInterface::readRaster(path); }); - return boost::make_optional(rasters); + return std::make_optional(rasters); } } // end namespace FileIO diff --git a/BaseLib/Algorithm.h b/BaseLib/Algorithm.h index b7ebba8c49ed7b5c69a42c060756bbaecef29c48..edfb60467594a0bed8a5bfb723ef37e8841c64dd 100644 --- a/BaseLib/Algorithm.h +++ b/BaseLib/Algorithm.h @@ -278,7 +278,7 @@ std::optional<typename Container::value_type> findFirstNotEqualElement( [&element](typename Container::value_type const& e) { return e == element; }); - return it == container.end() ? boost::none : boost::make_optional(*it); + return it == container.end() ? std::nullopt : std::make_optional(*it); } /// Returns the index of first element in container or, if the element is not diff --git a/BaseLib/ConfigTree-impl.h b/BaseLib/ConfigTree-impl.h index 54f4e610efda677c23216f069478d7120093b99e..3b7191313aef7a59b9756576988bed8020047cf6 100644 --- a/BaseLib/ConfigTree-impl.h +++ b/BaseLib/ConfigTree-impl.h @@ -79,7 +79,7 @@ std::optional<T> ConfigTree::getConfigParameterOptionalImpl( return p->getValue<T>(); } - return boost::none; + return std::nullopt; } template <typename T> @@ -103,13 +103,13 @@ std::optional<std::vector<T>> ConfigTree::getConfigParameterOptionalImpl( "' not convertible to a vector of the desired type." " Could not convert token no. " + std::to_string(result.size() + 1) + "."); - return boost::none; + return std::nullopt; } - return boost::make_optional(result); + return std::make_optional(result); } - return boost::none; + return std::nullopt; } template<typename T> @@ -225,7 +225,7 @@ std::optional<T> ConfigTree::getConfigAttributeOptional( if (auto a = attrs->get_child_optional(attr)) { ++ct.count; // count only if attribute has been found if (auto v = a->get_value_optional<T>()) { - return v; + return std::make_optional(*v); } error("Value for XML attribute '" + attr + "' `" + shortString(a->data()) + @@ -233,7 +233,7 @@ std::optional<T> ConfigTree::getConfigAttributeOptional( } } - return boost::none; + return std::nullopt; } template<typename T> diff --git a/BaseLib/ConfigTree.cpp b/BaseLib/ConfigTree.cpp index dda172e81cb6774cb9225953caa741a54aa6d7e3..e99c2770991782c713eb3661eac724cc34571aed 100644 --- a/BaseLib/ConfigTree.cpp +++ b/BaseLib/ConfigTree.cpp @@ -165,7 +165,7 @@ std::optional<ConfigTree> ConfigTree::getConfigSubtreeOptional( return ConfigTree(*subtree, *this, root); } markVisited(root, Attr::TAG, true); - return boost::none; + return std::nullopt; } Range<ConfigTree::SubtreeIterator> diff --git a/GeoLib/SurfaceGrid.cpp b/GeoLib/SurfaceGrid.cpp index 253283426b8da213d4b7aa397690dd7e5dfcd652..c48462e66161f1258a235d516150e07f3b881919 100644 --- a/GeoLib/SurfaceGrid.cpp +++ b/GeoLib/SurfaceGrid.cpp @@ -209,7 +209,7 @@ bool SurfaceGrid::isPointInSurface(MathLib::Point3d const& pnt, if (!optional_c) { return false; } - std::array<std::size_t,3> c(optional_c.get()); + std::array<std::size_t, 3> c(optional_c.value()); std::size_t const grid_cell_idx(c[0]+c[1]*_n_steps[0]+c[2]*_n_steps[0]*_n_steps[1]); std::vector<Triangle const*> const& triangles(_triangles_in_grid_box[grid_cell_idx]); diff --git a/MaterialLib/PorousMedium/PorousMediaProperties.cpp b/MaterialLib/PorousMedium/PorousMediaProperties.cpp index 798abf5214c43a3f8b9309df2078a728446bc2f2..a9a47d702dd267a46c25c42369bc2aed7b12dfba 100644 --- a/MaterialLib/PorousMedium/PorousMediaProperties.cpp +++ b/MaterialLib/PorousMedium/PorousMediaProperties.cpp @@ -17,7 +17,7 @@ namespace PorousMedium int PorousMediaProperties::getMaterialID( ParameterLib::SpatialPosition const& pos) const { - return _material_ids ? (*_material_ids)[pos.getElementID().get()] : 0; + return _material_ids ? (*_material_ids)[pos.getElementID().value()] : 0; } MaterialLib::PorousMedium::Porosity const& PorousMediaProperties::getPorosity( diff --git a/MaterialLib/SolidModels/MFront/MFront.cpp b/MaterialLib/SolidModels/MFront/MFront.cpp index f5fb7f716e9b1349d2acc240801670a59d91fe39..4476181ef2fc73681fe20921b948fcab8476a615 100644 --- a/MaterialLib/SolidModels/MFront/MFront.cpp +++ b/MaterialLib/SolidModels/MFront/MFront.cpp @@ -179,7 +179,7 @@ MFront<DisplacementDim>::MFront( getEquivalentPlasticStrainOffset(_behaviour)), _material_properties(std::move(material_properties)), _local_coordinate_system( - local_coordinate_system ? &local_coordinate_system.get() : nullptr) + local_coordinate_system ? &local_coordinate_system.value() : nullptr) { auto const hypothesis = behaviour.hypothesis; diff --git a/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h b/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h index 4e2f9d2a0b3e984127d0bc2c0e7329a75ce3df37..d7e03d431e07816bc019c65354332efc6ddea708 100644 --- a/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h +++ b/MeshLib/IO/MPI_IO/PropertyVectorMetaData.h @@ -92,24 +92,24 @@ inline std::optional<PropertyVectorMetaData> readPropertyVectorMetaData( char *dummy = new char[s]; if (!is.read(dummy, s)) { - return boost::none; + return std::nullopt; } pvmd.property_name = std::string(dummy, s); delete [] dummy; if(!is.read(reinterpret_cast<char*>(&pvmd.is_int_type), sizeof(bool))) - return boost::none; + return std::nullopt; if(!is.read(reinterpret_cast<char*>(&pvmd.is_data_type_signed), sizeof(bool))) - return boost::none; + return std::nullopt; if(!is.read(reinterpret_cast<char*>(&pvmd.data_type_size_in_bytes), sizeof(unsigned long))) - return boost::none; + return std::nullopt; if(!is.read(reinterpret_cast<char*>(&pvmd.number_of_components), sizeof(unsigned long))) - return boost::none; + return std::nullopt; if(!is.read(reinterpret_cast<char*>(&pvmd.number_of_tuples), sizeof(unsigned long))) - return boost::none; + return std::nullopt; return std::optional<PropertyVectorMetaData>(pvmd); } diff --git a/ParameterLib/FunctionParameter.h b/ParameterLib/FunctionParameter.h index 377d6c71a16f97349009011f8c1a5e9fd8a00726..69d1e0c9428d341a206939bb1d53773123ee9458 100644 --- a/ParameterLib/FunctionParameter.h +++ b/ParameterLib/FunctionParameter.h @@ -120,7 +120,7 @@ struct FunctionParameter final : public Parameter<T> "FunctionParameter: The spatial position has to be set by " "coordinates."); } - auto const coords = pos.getCoordinates().get(); + auto const coords = pos.getCoordinates().value(); x = coords[0]; y = coords[1]; z = coords[2]; diff --git a/ParameterLib/GroupBasedParameter.h b/ParameterLib/GroupBasedParameter.h index f18a1d820c5666737d428dc74932d39d168bc442..627293178c0f0feb8f9f01bff17730abd9d6bd24 100644 --- a/ParameterLib/GroupBasedParameter.h +++ b/ParameterLib/GroupBasedParameter.h @@ -63,7 +63,7 @@ struct GroupBasedParameter final : public Parameter<T> { auto const item_id = getMeshItemID(pos, type<MeshItemType>()); assert(item_id); - int const index = _property_index[item_id.get()]; + int const index = _property_index[item_id.value()]; auto const& values = _vec_values[index]; if (values.empty()) { diff --git a/ParameterLib/Parameter.h b/ParameterLib/Parameter.h index 337e6087a0ab4514337747b0d9fb52581f4150e0..197db43c68fac187dec819aa43bc0e270424f0fc 100644 --- a/ParameterLib/Parameter.h +++ b/ParameterLib/Parameter.h @@ -174,7 +174,7 @@ struct Parameter : public ParameterBase for (int i = 0; i < n_nodes; ++i) { x_position.setAll( - nodes[i]->getID(), element.getID(), boost::none, *nodes[i]); + nodes[i]->getID(), element.getID(), std::nullopt, *nodes[i]); auto const& values = this->operator()(t, x_position); auto const row_values = Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, 1> const>( diff --git a/ParameterLib/SpatialPosition.h b/ParameterLib/SpatialPosition.h index 75e8080c0d62235178f98ae97e8d3fa980f21921..da2709ecc08334c51660618131e307b9b2cad16d 100644 --- a/ParameterLib/SpatialPosition.h +++ b/ParameterLib/SpatialPosition.h @@ -89,10 +89,10 @@ public: void clear() { - _node_id = boost::none; - _element_id = boost::none; - _integration_point = boost::none; - _coordinates = boost::none; + _node_id = std::nullopt; + _element_id = std::nullopt; + _integration_point = std::nullopt; + _coordinates = std::nullopt; } private: diff --git a/ProcessLib/BoundaryCondition/NeumannBoundaryConditionLocalAssembler.h b/ProcessLib/BoundaryCondition/NeumannBoundaryConditionLocalAssembler.h index 990c1361cdbf91252127b85951223d64ea72d74d..11bf2f6e97fe67c3be2a96f6fed7f933ad21557c 100644 --- a/ProcessLib/BoundaryCondition/NeumannBoundaryConditionLocalAssembler.h +++ b/ProcessLib/BoundaryCondition/NeumannBoundaryConditionLocalAssembler.h @@ -76,7 +76,7 @@ public: auto const& w = ip_data.weight; ParameterLib::SpatialPosition const position{ - boost::none, Base::_element.getID(), ip, + std::nullopt, Base::_element.getID(), ip, MathLib::Point3d( NumLib::interpolateCoordinates<ShapeFunction, ShapeMatricesType>( diff --git a/ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h b/ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h index dae3ed423ee4e7a34caf985e30dfeffc6911af97..3698b84db5e857c992f735dc504baf0f922219bb 100644 --- a/ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h +++ b/ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h @@ -73,7 +73,7 @@ public: auto const& w = ip_data.weight; ParameterLib::SpatialPosition const position{ - boost::none, Base::_element.getID(), ip, + std::nullopt, Base::_element.getID(), ip, MathLib::Point3d( NumLib::interpolateCoordinates<ShapeFunction, ShapeMatricesType>( diff --git a/ProcessLib/RichardsComponentTransport/PorousMediaProperties.cpp b/ProcessLib/RichardsComponentTransport/PorousMediaProperties.cpp index b6aec9ba1b9ffb2955e7add10810cfa1898b43f3..c8f8f0cfafeb859a352a98f732c552e9bfc9371e 100644 --- a/ProcessLib/RichardsComponentTransport/PorousMediaProperties.cpp +++ b/ProcessLib/RichardsComponentTransport/PorousMediaProperties.cpp @@ -17,7 +17,7 @@ namespace RichardsComponentTransport int PorousMediaProperties::getMaterialID( ParameterLib::SpatialPosition const& pos) const { - int const element_id = pos.getElementID().get(); + int const element_id = pos.getElementID().value(); return _material_ids[element_id]; } diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h index 1f43d85ee21f9cada6dfad91c74f1b7a38b8ed5a..5d9c3b56e4e3ff073dd5bf27af7f27eca2d9c3a2 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsFEM.h @@ -130,7 +130,7 @@ public: if (_process_data.initial_stress != nullptr) { ParameterLib::SpatialPosition const x_position{ - boost::none, _element.getID(), ip, + std::nullopt, _element.getID(), ip, MathLib::Point3d(NumLib::interpolateCoordinates< ShapeFunctionDisplacement, ShapeMatricesTypeDisplacement>( diff --git a/ProcessLib/SmallDeformation/SmallDeformationFEM.h b/ProcessLib/SmallDeformation/SmallDeformationFEM.h index 4b254b2f70dc78257df16c821afa92dcdcf738ac..5ac7d11edc965ec22d86956c3f03983d321a2ea4 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationFEM.h +++ b/ProcessLib/SmallDeformation/SmallDeformationFEM.h @@ -207,7 +207,7 @@ public: if (_process_data.initial_stress != nullptr) { ParameterLib::SpatialPosition const x_position{ - boost::none, _element.getID(), ip, + std::nullopt, _element.getID(), ip, MathLib::Point3d( NumLib::interpolateCoordinates<ShapeFunction, ShapeMatricesType>( diff --git a/ProcessLib/SourceTerms/VolumetricSourceTermFEM.h b/ProcessLib/SourceTerms/VolumetricSourceTermFEM.h index 724dbd5fde81b98de9bd82aed29706b9c14edf8d..8f750e3bc139649ddfbe24b4b8206f111a32b036 100644 --- a/ProcessLib/SourceTerms/VolumetricSourceTermFEM.h +++ b/ProcessLib/SourceTerms/VolumetricSourceTermFEM.h @@ -92,7 +92,7 @@ public: auto const& w = _ip_data[ip].integration_weight; ParameterLib::SpatialPosition const pos{ - boost::none, _element.getID(), ip, + std::nullopt, _element.getID(), ip, MathLib::Point3d( NumLib::interpolateCoordinates<ShapeFunction, ShapeMatricesType>(_element, diff --git a/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h b/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h index f15da09d7fd16dd95b116a96e3f7b54d1b846c82..f2660af759cbf820242b692377fb1ab737f76fa3 100644 --- a/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h +++ b/ProcessLib/ThermalTwoPhaseFlowWithPP/ThermalTwoPhaseFlowWithPPLocalAssembler-impl.h @@ -143,7 +143,7 @@ void ThermalTwoPhaseFlowWithPPLocalAssembler< auto const& two_phase_material_model = _process_data.material->getTwoPhaseMaterialModel(); const int material_id = - two_phase_material_model.getMaterialID(pos.getElementID().get()); + two_phase_material_model.getMaterialID(pos.getElementID().value()); auto const num_nodes = ShapeFunction::NPOINTS; auto const pg_nodal_values = diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h index f677c9f17a222f64cd4c2aaa5511fc3c2425124e..1520ffc7a831073779a7e14bb99d64776e24e43d 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h @@ -208,7 +208,7 @@ public: if (_process_data.initial_stress != nullptr) { ParameterLib::SpatialPosition const x_position{ - boost::none, _element.getID(), ip, + std::nullopt, _element.getID(), ip, MathLib::Point3d( NumLib::interpolateCoordinates<ShapeFunction, ShapeMatricesType>( diff --git a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h index 258424a97033b25d0a8c75c36a817cd3618d67da..3ae5241ab5374c974ee06368e2e19ec59f53f652 100644 --- a/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h +++ b/ProcessLib/ThermoRichardsMechanics/ThermoRichardsMechanicsFEM.h @@ -117,7 +117,7 @@ public: if (process_data_.initial_stress != nullptr) { ParameterLib::SpatialPosition const x_position{ - boost::none, element_.getID(), ip, + std::nullopt, element_.getID(), ip, MathLib::Point3d(NumLib::interpolateCoordinates< ShapeFunctionDisplacement, ShapeMatricesTypeDisplacement>( diff --git a/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoLocalAssembler-impl.h b/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoLocalAssembler-impl.h index 8b5af543336b2b15c4dc2ca49ae33d3d1d294dc1..5f04e95f03af81faf8e2ac840427146bcdcd41ba 100644 --- a/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoLocalAssembler-impl.h +++ b/ProcessLib/TwoPhaseFlowWithPrho/TwoPhaseFlowWithPrhoLocalAssembler-impl.h @@ -82,7 +82,7 @@ void TwoPhaseFlowWithPrhoLocalAssembler< ParameterLib::SpatialPosition pos; pos.setElementID(_element.getID()); const int material_id = - _process_data._material->getMaterialID(pos.getElementID().get()); + _process_data._material->getMaterialID(pos.getElementID().value()); const Eigen::MatrixXd& perm = _process_data._material->getPermeability( material_id, t, pos, _element.getDimension()); diff --git a/Tests/MaterialLib/MFront.cpp b/Tests/MaterialLib/MFront.cpp index 20b322d14aba4dae1624f141f5c66ac4f01cea83..7edd62e5cb4af4e42fc048876c1b55ee33a20d04 100644 --- a/Tests/MaterialLib/MFront.cpp +++ b/Tests/MaterialLib/MFront.cpp @@ -56,7 +56,7 @@ struct StandardElasticityBrickBehaviour &young_modulus, &poisson_ratio}; auto result = std::make_unique<MFront::MFront<Dim>>( - std::move(behaviour), std::move(parameters), boost::none); + std::move(behaviour), std::move(parameters), std::nullopt); return result; } }; @@ -77,7 +77,7 @@ struct ElasticBehaviour &young_modulus, &poisson_ratio}; auto result = std::make_unique<MFront::MFront<Dim>>( - std::move(behaviour), std::move(parameters), boost::none); + std::move(behaviour), std::move(parameters), std::nullopt); return result; } }; @@ -110,7 +110,7 @@ struct MohrCoulombAbboSloanBehaviour &tension_cut_off_parameter}; auto result = std::make_unique<MFront::MFront<Dim>>( - std::move(behaviour), std::move(parameters), boost::none); + std::move(behaviour), std::move(parameters), std::nullopt); return result; } }; diff --git a/Tests/MeshLib/ConvertToLinearMesh.cpp b/Tests/MeshLib/ConvertToLinearMesh.cpp index 1eee0f7074287214e4a75fad3b2cc9ae8f5fef23..0ecfc479a38b756aaeff844e0a6a5b18ad3d846f 100644 --- a/Tests/MeshLib/ConvertToLinearMesh.cpp +++ b/Tests/MeshLib/ConvertToLinearMesh.cpp @@ -214,7 +214,7 @@ TEST_F(ConvertToLinearMesh, GeneratedHexMeshRandomizedNodes) { auto const result = inversePermutationIdentityTest(permutation, inverse_permutation); - ASSERT_TRUE(result == boost::none) + ASSERT_TRUE(result == std::nullopt) << "Quadratic mesh nodes permutation test failed: " << *result; } @@ -253,7 +253,7 @@ TEST_F(ConvertToLinearMesh, GeneratedHexMeshRandomizedNodes) auto const& element_b = *permuted_nodes_quadratic_mesh.getElement(i); auto const elements_are_equal = equal(element_a, element_b); - ASSERT_TRUE(elements_are_equal == boost::none) + ASSERT_TRUE(elements_are_equal == std::nullopt) << *elements_are_equal << " For the element " << i << "."; } } @@ -285,7 +285,7 @@ TEST_F(ConvertToLinearMesh, GeneratedHexMeshRandomizedNodes) auto const& element_a = *linear_mesh->getElement(i); auto const& element_b = *converted_mesh->getElement(i); auto const elements_are_equal = equal(element_a, element_b); - ASSERT_TRUE(elements_are_equal == boost::none) + ASSERT_TRUE(elements_are_equal == std::nullopt) << *elements_are_equal << " For the element " << i << "."; } } @@ -320,7 +320,7 @@ TEST_F(ConvertToLinearMesh, GeneratedHexMeshBackToLinear) auto const& converted_mesh_element = *converted_mesh->getElement(i); auto const elements_are_equal = equal(linear_mesh_element, converted_mesh_element); - ASSERT_TRUE(elements_are_equal == boost::none) + ASSERT_TRUE(elements_are_equal == std::nullopt) << *elements_are_equal << " For the element " << i << "."; } } diff --git a/Tests/NumLib/TestODEInt.cpp b/Tests/NumLib/TestODEInt.cpp index 47358596b3bb144f7d3f277be59b76f2d7497679..5a1cd51bba5b5385d08bfddba11474a344f56ac7 100644 --- a/Tests/NumLib/TestODEInt.cpp +++ b/Tests/NumLib/TestODEInt.cpp @@ -76,7 +76,7 @@ public: auto linear_solver = createLinearSolver(); auto conv_crit = std::make_unique<NumLib::ConvergenceCriterionDeltaX>( - _tol, boost::none, MathLib::VecNormType::NORM2); + _tol, std::nullopt, MathLib::VecNormType::NORM2); auto nonlinear_solver = std::make_unique<NLSolver>(*linear_solver, _maxiter);