Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
db870cc
[CI] Testing the C++20 compilation
loumalouomega Jun 21, 2025
5ea376a
Update ci.yml
roigcarlo Jun 23, 2025
71ee2f0
Merge branch 'master' into ci/test-c++20
loumalouomega Jun 26, 2025
833f484
fixing c++20 problems
RiccardoRossi Jun 26, 2025
cfc7f84
Merge branch 'ci/test-c++20' of github.com:KratosMultiphysics/Kratos
roigcarlo Jul 7, 2025
ab3ee3c
Fix compilation warnings and deprecations
roigcarlo Jul 8, 2025
b30740c
Cleaning code to avoid type problems
roigcarlo Jul 8, 2025
0a8cefc
Merge branch 'master' into ci/test-c++20
loumalouomega Jul 21, 2025
5ded964
Merge branch 'master' into ci/test-c++20
loumalouomega Sep 3, 2025
67a644f
Merge branch 'master' into ci/test-c++20
loumalouomega Oct 15, 2025
34ba715
[Core] Fix UTF8 literal issue in MSVC with C++20
loumalouomega Oct 15, 2025
9c1d414
Revert UTF-8
loumalouomega Oct 16, 2025
503d6ac
[LinearSolversApplication] Update Eigen library to 5.0.0
loumalouomega Oct 16, 2025
49a2fc7
Merge pull request #13888 from KratosMultiphysics/linear/update-eigen…
loumalouomega Oct 18, 2025
4c606cb
Cast DomainType to double for nodal_distance calculation
RiccardoRossi Oct 19, 2025
81b0d38
Merge pull request #13886 from KratosMultiphysics/ci/c++20-literals-utf8
loumalouomega Oct 20, 2025
5a7da1d
Merge branch 'master' into ci/test-c++20
loumalouomega Oct 21, 2025
f0b43a2
Merge branch 'master' into ci/test-c++20
loumalouomega Oct 29, 2025
e3f50b2
Merge master
loumalouomega Oct 30, 2025
db45dd3
[CoSimulationApplication] Update `CoSimIO` to last version
loumalouomega Oct 30, 2025
3a8020c
Revert "[CoSimulationApplication] Update `CoSimIO` to last version"
loumalouomega Oct 30, 2025
865cda5
Merge branch 'master' into ci/test-c++20
loumalouomega Nov 3, 2025
cc345d2
bump boost from unity core and intel to 1.87
roigcarlo Nov 3, 2025
3248d9e
Deactivate PCH
loumalouomega Nov 3, 2025
b431ab5
Merge branch 'master' into ci/test-c++20
loumalouomega Nov 28, 2025
8ffa202
Merge branch 'master' into ci/test-c++20
roigcarlo Dec 15, 2025
be32d2b
Merge branch 'ci/test-c++20' of github.com:KratosMultiphysics/Kratos …
roigcarlo Dec 16, 2025
ec97218
Fix system boost being used in non-unity and intel builds
roigcarlo Dec 16, 2025
d773a1c
Merge branch 'master' into ci/test-c++20
loumalouomega Dec 16, 2025
078df61
Fixing BaseSocketCommunication
roigcarlo Dec 16, 2025
275c010
Merge branch 'ci/test-c++20' of github.com:KratosMultiphysics/Kratos …
roigcarlo Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ jobs:
cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
-DUSE_MPI=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DBOOST_ROOT="/workspace/boost/boost_1_87_0" \
-DBoost_NO_SYSTEM_PATHS=ON \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \
-DTRILINOS_LIBRARY_PREFIX="trilinos_" \
Expand Down Expand Up @@ -518,7 +520,7 @@ jobs:
-DBOOST_ROOT="%TEMP%\boost" ^
-DCMAKE_CXX_FLAGS="/Od /we4661 /we4804 /WX /wd4996" ^
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^
-DKRATOS_USE_PCH=ON ^
-DKRATOS_USE_PCH=OFF ^
-DFORCE_LOCAL_ZLIB_COMPILATION=ON || goto :error

cmake --build "%KRATOS_BUILD%\%KRATOS_BUILD_TYPE%" --target all_build -- /property:configuration=%KRATOS_BUILD_TYPE% /p:Platform=x64 || goto :error
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/intel_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ cmake -H"${KRATOS_SOURCE}" -B"${KRATOS_BUILD}/${KRATOS_BUILD_TYPE}" \
${KRATOS_CMAKE_OPTIONS_FLAGS} \
-DUSE_MPI=ON \
-DPYTHON_EXECUTABLE="/usr/bin/python3.10" \
-DBOOST_ROOT="/workspace/boost/boost_1_87_0" \
-DBoost_NO_SYSTEM_PATHS=ON \
-DCMAKE_CXX_FLAGS="${KRATOS_CMAKE_CXX_FLAGS} -O3 -Wall -Werror-all -diag-disable 1478 -diag-disable 1786" \
-DTRILINOS_INCLUDE_DIR="/usr/include/trilinos" \
-DTRILINOS_LIBRARY_DIR="/usr/lib/x86_64-linux-gnu" \
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 3.15.0)

project (KratosMultiphysics)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_CXX_EXTENSIONS OFF)

Expand Down Expand Up @@ -170,6 +170,11 @@ ELSE(CMAKE_VERSION VERSION_LESS "3.16.0")
ENDIF(CMAKE_UNITY_BUILD MATCHES ON)
ENDIF(CMAKE_VERSION VERSION_LESS "3.16.0")

# Add /utf-8 as a source file encoding flag for MSVC
if(MSVC)
add_compile_options("/utf-8")
endif()

# Get subversion data. This is done automagically by the cmakes
include (GenerateExportHeader)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[license-image]: https://img.shields.io/badge/license-BSD-green.svg?style=flat
[license]: https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/license.txt

[c++-image]: https://img.shields.io/badge/C++-17-blue.svg?style=flat&logo=c%2B%2B
[c++-image]: https://img.shields.io/badge/C++-20-blue.svg?style=flat&logo=c%2B%2B
[c++standard]: https://isocpp.org/std/the-standard

[Nightly-Build]: https://github.com/KratosMultiphysics/Kratos/workflows/Nightly%20Build/badge.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace CoSimIO {
namespace Internals {

template<class TSocketType>
BaseSocketCommunication<TSocketType>::~BaseSocketCommunication<TSocketType>()
BaseSocketCommunication<TSocketType>::~BaseSocketCommunication()
{
CO_SIM_IO_TRY

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ namespace Kratos
mvector_of_particle_pointers_vectors.resize(mnelems);
//int artz;
//std::cin >> artz;
int i_int=0; //careful! it's not the id, but the position inside the array!
std::cout << "about to create particles" << std::endl;
//now we seed: LOOP IN ELEMENTS
//using loop index, DO NOT parallelize this! change lines : mparticles_in_elems_pointers((ii*mmaximum_number_of_particles)+mparticles_in_elems_integers(ii)) = pparticle; and the next one
Expand All @@ -230,7 +229,6 @@ namespace Kratos

Geometry< Node >& geom = ielem->GetGeometry();
//unsigned int elem_id = ielem->Id();
//mareas_vector[i_int]=CalculateArea(geom); UNUSED SO COMMENTED
ComputeGaussPointPositions_initial(geom, pos, N); //we also have the standard (4), and 45
//now we seed the particles in the current element
for (unsigned int j = 0; j < pos.size1(); j++)
Expand All @@ -257,7 +255,6 @@ namespace Kratos
number_of_particles++ ;

}
++i_int;
}

m_nparticles=particle_id; //we save the last particle created as the total number of particles we have. For the moment this is true.
Expand Down Expand Up @@ -1173,8 +1170,6 @@ namespace Kratos

#pragma omp parallel firstprivate(elem_partition) // firstprivate(results)//we will add the nodes in different parts of aux and later assemble everything together, remaming particles ids to get consecutive ids
{
unsigned int reused_particles=0;

unsigned int freeparticle = 0; //we start by the first position;

int k = OpenMPUtils::ThisThread();
Expand Down Expand Up @@ -1273,10 +1268,6 @@ namespace Kratos
{
KRATOS_THROW_ERROR(std::logic_error, "FINISHED THE LIST AND COULDN'T FIND A FREE CELL FOR THE NEW PARTICLE!", "");
}
else
{
reused_particles++;
}

}
}
Expand Down
19 changes: 10 additions & 9 deletions applications/FluidDynamicsApplication/custom_elements/dpg_vms.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,17 @@ class DPGVMS : public VMS<TDim, TNumNodes>
ElementBaseType::CalculateLocalVelocityContribution(rDampingMatrix, rRightHandSideVector, rCurrentProcessInfo);

//compute boundary term
int boundary_nodes = 0;
// int boundary_nodes = 0;
//unsigned int inside_index = -1;
for (unsigned int i = 0; i < TNumNodes; i++)
{
double nd_flag = this->GetGeometry()[i].FastGetSolutionStepValue(FLAG_VARIABLE);
if (nd_flag == 5.0)
boundary_nodes++;
//else
//inside_index = i;
}

// for (unsigned int i = 0; i < TNumNodes; i++)
// {
// double nd_flag = this->GetGeometry()[i].FastGetSolutionStepValue(FLAG_VARIABLE);
// if (nd_flag == 5.0)
// boundary_nodes++;
// //else
// //inside_index = i;
// }


/* if(boundary_nodes == TDim)
Expand Down
8 changes: 4 additions & 4 deletions external_libraries/delaunator-cpp/include/delaunator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ Delaunator::Delaunator(std::vector<double> const& in_coords)

hull_start = i0;

size_t hull_size = 3;
// size_t hull_size = 3;

hull_next[i0] = hull_prev[i2] = i1;
hull_next[i1] = hull_prev[i0] = i2;
Expand Down Expand Up @@ -388,7 +388,7 @@ Delaunator::Delaunator(std::vector<double> const& in_coords)

hull_tri[i] = legalize(t + 2);
hull_tri[e] = t;
hull_size++;
// hull_size++;

// walk forward through the hull, adding more triangles and flipping recursively
std::size_t next = hull_next[e];
Expand All @@ -398,7 +398,7 @@ Delaunator::Delaunator(std::vector<double> const& in_coords)
t = add_triangle(next, i, q, hull_tri[i], INVALID_INDEX, hull_tri[next]);
hull_tri[i] = legalize(t + 2);
hull_next[next] = next; // mark as removed
hull_size--;
// hull_size--;
next = q;
}

Expand All @@ -411,7 +411,7 @@ Delaunator::Delaunator(std::vector<double> const& in_coords)
legalize(t + 2);
hull_tri[q] = t;
hull_next[e] = e; // mark as removed
hull_size--;
// hull_size--;
e = q;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,6 @@ class CalculateSignedDistanceTo3DSkinProcess
array_1d<double,4>& Npos,
array_1d<double,4>& Nneg)
{
//count positives
int n_positives = 0;
for(unsigned int i=0; i<distances.size(); i++)
if(distances[i]>0) n_positives++;

//generate the points on the edges at the zero of the distance function
//generate "father nodes", defined as the end nodes of the edge on which the local point is located
std::vector< Point > edge_points;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

// Project includes
#include "containers/edge_based_data_structure.h"
#include "includes/define.h"
#include "processes/process.h"
#include "solving_strategies/strategies/butcher_tableau.h"
#include "utilities/atomic_utilities.h"
Expand Down Expand Up @@ -180,12 +179,12 @@ class FluxCorrectedTransportConvectionProcess : public Process
const double max_dt = std::min(cfl_dt, mMaxAllowedDt); // Check if the user defined delta time is more restrictive than the CFL one
const SizeType n_steps = std::ceil(target_dt / max_dt); // Required number of substeps (rounded up)
const double dt = target_dt / n_steps; // Time increment to be used in the substep loop
KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 0) << u8"Solving FCT convection with \u0394t = " << dt << u8" (max allowed \u0394t = " << max_dt << ")" << std::endl;
KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 0) << "Solving FCT convection with \u0394t = " << dt << " (max allowed \u0394t = " << max_dt << ")" << std::endl;

// Substepping time loop
for (IndexType step = 1; step <= n_steps; ++step) {
// Solve current substep
KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 1) << "Substep = " << step << " - Time = " << prev_time << u8" - \u0394t = " << dt << std::endl;
KRATOS_INFO_IF("FluxCorrectedTransportConvectionProcess", mEchoLevel > 1) << "Substep = " << step << " - Time = " << prev_time << " - \u0394t = " << dt << std::endl;
this->SolveSubStep(dt);

// Advance in time
Expand Down Expand Up @@ -962,4 +961,4 @@ inline std::ostream& operator << (
}
///@}

} // namespace Kratos.
} // namespace Kratos.
8 changes: 4 additions & 4 deletions kratos/spatial_containers/bins_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class BinsDynamic
/// Pointer definition of BinsDynamic
KRATOS_CLASS_POINTER_DEFINITION(BinsDynamic);

enum { Dimension = TDimension };
constexpr static std::size_t Dimension = TDimension;

using PointType = TPointType;
using BoundingBoxType = BoundingBox<PointType>;
Expand Down Expand Up @@ -345,20 +345,20 @@ class BinsDynamic
std::array<double, 3> lengths;
double average_length = 0.0;

for (int i = 0; i < Dimension; i++) {
for (std::size_t i = 0; i < Dimension; i++) {
lengths[i] = GetMaxPoint()[i] - GetMinPoint()[i];
average_length += lengths[i];
}
average_length *= 1.0 / 3.0;

if (average_length < std::numeric_limits<double>::epsilon()) {
for(int i = 0; i < Dimension; i++) {
for(std::size_t i = 0; i < Dimension; i++) {
mN[i] = 1;
}
return;
}

for (int i = 0; i < Dimension; i++) {
for (std::size_t i = 0; i < Dimension; i++) {
mN[i] = static_cast<std::size_t>(lengths[i] / average_length * (double)average_number_of_cells) + 1;

if (mN[i] > 1) {
Expand Down
Loading
Loading