From 51b3e46f653dcaf2a0fd363fa283e794abae5a36 Mon Sep 17 00:00:00 2001 From: rubenzorrilla Date: Thu, 12 Dec 2024 19:35:23 +0100 Subject: [PATCH] Moving BlockSize to data container --- .../axisymmetric_navier_stokes_data.h | 2 ++ .../custom_elements/data_containers/embedded_data.h | 2 ++ .../data_containers/embedded_discontinuous_data.h | 3 +++ .../custom_elements/data_containers/fic/fic_data.h | 2 ++ .../custom_elements/data_containers/fluid_element_data.h | 3 --- .../custom_elements/data_containers/qs_vms/qs_vms_data.h | 2 ++ .../qs_vms_dem_coupled/qs_vms_dem_coupled_data.h | 3 +-- .../custom_elements/data_containers/stokes/stokes_data.h | 2 ++ .../time_integrated_fic/time_integrated_fic_data.h | 2 ++ .../time_integrated_qs_vms/time_integrated_qs_vms_data.h | 2 ++ .../two_fluid_navier_stokes/two_fluid_navier_stokes_data.h | 2 ++ .../two_fluid_navier_stokes_alpha_method_data.h | 2 ++ .../weakly_compressible_navier_stokes_data.h | 2 ++ .../FluidDynamicsApplication/custom_elements/fluid_element.h | 2 +- 14 files changed, 25 insertions(+), 6 deletions(-) diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/axisymmetric_navier_stokes/axisymmetric_navier_stokes_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/axisymmetric_navier_stokes/axisymmetric_navier_stokes_data.h index b43020a70137..c6dfea60dd31 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/axisymmetric_navier_stokes/axisymmetric_navier_stokes_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/axisymmetric_navier_stokes/axisymmetric_navier_stokes_data.h @@ -48,6 +48,8 @@ using NodalVectorData = typename FluidElementData::NodalVe using ShapeFunctionsType = typename FluidElementData::ShapeFunctionsType; using MatrixRowType = typename FluidElementData::MatrixRowType; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_data.h index ce0686536cc6..af38acbb796e 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_data.h @@ -38,6 +38,8 @@ using NodalVectorData = typename TFluidData::NodalVectorData; typedef GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType; typedef std::vector> InterfaceNormalsType; +static constexpr std::size_t BlockSize = TFluidData::BlockSize; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_discontinuous_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_discontinuous_data.h index ce683468236c..25a3fd5f5fe6 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_discontinuous_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/embedded_discontinuous_data.h @@ -38,6 +38,9 @@ using NodalVectorData = typename TFluidData::NodalVectorData; typedef GeometryData::ShapeFunctionsGradientsType ShapeFunctionsGradientsType; typedef std::vector> InterfaceNormalsType; +/// Number of nodal unknowns (taken from underlying element data) +static constexpr std::size_t BlockSize = TFluidData::BlockSize; + /// Number of edges of the element (simplex elements are assumed) constexpr static std::size_t NumEdges = (TFluidData::NumNodes == 3) ? 3 : 6; diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/fic/fic_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/fic/fic_data.h index c3aae8f59b99..0892057805e1 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/fic/fic_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/fic/fic_data.h @@ -36,6 +36,8 @@ class FICData : public FluidElementData::NodalScalarData; using NodalVectorData = typename FluidElementData::NodalVectorData; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/fluid_element_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/fluid_element_data.h index 40b7f3fc436a..7f8f968bb19e 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/fluid_element_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/fluid_element_data.h @@ -57,9 +57,6 @@ class KRATOS_API(FLUID_DYNAMICS_APPLICATION) FluidElementData /// Number of nodes of the element. constexpr static unsigned int NumNodes = TNumNodes; - /// Number of local unknowns (assuming velocity and pressure) - constexpr static unsigned int BlockSize = TDim + 1; - /// Size of the strain and stress vectors (in Voigt notation) for the formulation constexpr static unsigned int StrainSize = (TDim-1)*3; // 3 in 2D, 6 in 3D diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms/qs_vms_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms/qs_vms_data.h index f25a683ce151..4d832cb5f982 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms/qs_vms_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms/qs_vms_data.h @@ -36,6 +36,8 @@ class QSVMSData : public FluidElementData::NodalScalarData; using NodalVectorData = typename FluidElementData::NodalVectorData; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms_dem_coupled/qs_vms_dem_coupled_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms_dem_coupled/qs_vms_dem_coupled_data.h index ffe6c8662f8e..d5e4df4e1394 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms_dem_coupled/qs_vms_dem_coupled_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/qs_vms_dem_coupled/qs_vms_dem_coupled_data.h @@ -46,8 +46,7 @@ class QSVMSDEMCoupledData : public QSVMSData::NodalScalarData; diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/stokes/stokes_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/stokes/stokes_data.h index 55f43f64dbc7..1b8a3bf4c0d7 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/stokes/stokes_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/stokes/stokes_data.h @@ -46,6 +46,8 @@ using NodalVectorData = typename FluidElementData::NodalV using ShapeFunctionsType = typename FluidElementData::ShapeFunctionsType; using MatrixRowType = typename FluidElementData::MatrixRowType; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_fic/time_integrated_fic_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_fic/time_integrated_fic_data.h index 1575e677a9a0..14075e40d076 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_fic/time_integrated_fic_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_fic/time_integrated_fic_data.h @@ -35,6 +35,8 @@ class TimeIntegratedFICData : public FICData using NodalScalarData = typename FluidElementData::NodalScalarData; using NodalVectorData = typename FluidElementData::NodalVectorData; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_qs_vms/time_integrated_qs_vms_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_qs_vms/time_integrated_qs_vms_data.h index 033e43476c15..f34108f6a624 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_qs_vms/time_integrated_qs_vms_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/time_integrated_qs_vms/time_integrated_qs_vms_data.h @@ -35,6 +35,8 @@ class TimeIntegratedQSVMSData : public QSVMSData using NodalScalarData = typename FluidElementData::NodalScalarData; using NodalVectorData = typename FluidElementData::NodalVectorData; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes/two_fluid_navier_stokes_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes/two_fluid_navier_stokes_data.h index 0d204bdc61a2..ceaa2bc1e7a1 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes/two_fluid_navier_stokes_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes/two_fluid_navier_stokes_data.h @@ -45,6 +45,8 @@ using MatrixRowType = typename FluidElementData::MatrixRo typedef Geometry GeometryType; typedef GeometryType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes_alpha_method/two_fluid_navier_stokes_alpha_method_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes_alpha_method/two_fluid_navier_stokes_alpha_method_data.h index 7398cd75eb3f..dfaf01c1eeb7 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes_alpha_method/two_fluid_navier_stokes_alpha_method_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/two_fluid_navier_stokes_alpha_method/two_fluid_navier_stokes_alpha_method_data.h @@ -45,6 +45,8 @@ using MatrixRowType = typename FluidElementData::MatrixRo typedef Geometry GeometryType; typedef GeometryType::ShapeFunctionsGradientsType ShapeFunctionsGradientsType; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/data_containers/weakly_compressible_navier_stokes/weakly_compressible_navier_stokes_data.h b/applications/FluidDynamicsApplication/custom_elements/data_containers/weakly_compressible_navier_stokes/weakly_compressible_navier_stokes_data.h index fb82a1d6965a..e7a8267d7baf 100644 --- a/applications/FluidDynamicsApplication/custom_elements/data_containers/weakly_compressible_navier_stokes/weakly_compressible_navier_stokes_data.h +++ b/applications/FluidDynamicsApplication/custom_elements/data_containers/weakly_compressible_navier_stokes/weakly_compressible_navier_stokes_data.h @@ -49,6 +49,8 @@ using NodalVectorData = typename FluidElementData::NodalVe using ShapeFunctionsType = typename FluidElementData::ShapeFunctionsType; using MatrixRowType = typename FluidElementData::MatrixRowType; +static constexpr std::size_t BlockSize = TDim + 1; + ///@} ///@name Public Members ///@{ diff --git a/applications/FluidDynamicsApplication/custom_elements/fluid_element.h b/applications/FluidDynamicsApplication/custom_elements/fluid_element.h index 9a3ab7e2006b..47c941fb8151 100644 --- a/applications/FluidDynamicsApplication/custom_elements/fluid_element.h +++ b/applications/FluidDynamicsApplication/custom_elements/fluid_element.h @@ -106,7 +106,7 @@ class FluidElement : public Element static constexpr unsigned int NumNodes = TElementData::NumNodes; - static constexpr unsigned int BlockSize = Dim + 1; + static constexpr unsigned int BlockSize = TElementData::BlockSize; static constexpr unsigned int LocalSize = NumNodes * BlockSize;