diff --git a/kratos/containers/variable.h b/kratos/containers/variable.h index 1179b93aeb80..148680547ee5 100644 --- a/kratos/containers/variable.h +++ b/kratos/containers/variable.h @@ -89,7 +89,6 @@ class Variable : public VariableData const VariableType* pTimeDerivativeVariable = nullptr ) : VariableData(NewName, sizeof(TDataType)), - mZero(Zero), mpTimeDerivativeVariable(pTimeDerivativeVariable) {} /** @@ -102,7 +101,6 @@ class Variable : public VariableData const VariableType* pTimeDerivativeVariable ) : VariableData(NewName, sizeof(TDataType)), - mZero(TDataType()), mpTimeDerivativeVariable(pTimeDerivativeVariable) {} @@ -118,8 +116,7 @@ class Variable : public VariableData char ComponentIndex, const TDataType Zero = TDataType() ) - : VariableData(rNewName, sizeof(TDataType), pSourceVariable, ComponentIndex), - mZero(Zero) + : VariableData(rNewName, sizeof(TDataType), pSourceVariable, ComponentIndex) {} /** @@ -137,7 +134,6 @@ class Variable : public VariableData const TDataType Zero = TDataType() ) : VariableData(rNewName, sizeof(TDataType), pSourceVariable, ComponentIndex), - mZero(Zero), mpTimeDerivativeVariable(pTimeDerivativeVariable) {} @@ -148,7 +144,6 @@ class Variable : public VariableData */ explicit Variable(const VariableType& rOtherVariable) : VariableData(rOtherVariable), - mZero(rOtherVariable.mZero), mpTimeDerivativeVariable(rOtherVariable.mpTimeDerivativeVariable) { // Here we don't register as we asume that the origin is already registered @@ -440,12 +435,12 @@ class Variable : public VariableData static const VariableType msStaticObject; /// Definition of the static variable + static const inline TDataType mZero = TDataType{}; + ///@} ///@name Member Variables ///@{ - TDataType mZero; /// The zero type contains the null value of the current variable type - const VariableType* mpTimeDerivativeVariable = nullptr; /// Definition of the pointer to the variable for the time derivative ///@} @@ -485,7 +480,6 @@ class Variable : public VariableData void save(Serializer& rSerializer) const override { KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, VariableData ); - rSerializer.save("Zero",mZero); rSerializer.save("TimeDerivativeVariable",mpTimeDerivativeVariable); } @@ -496,7 +490,6 @@ class Variable : public VariableData void load(Serializer& rSerializer) override { KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, VariableData ); - rSerializer.load("Zero",mZero); rSerializer.load("TimeDerivativeVariable",mpTimeDerivativeVariable); } diff --git a/kratos/includes/define.h b/kratos/includes/define.h index 9abf778ecf8e..ab214f5f236a 100644 --- a/kratos/includes/define.h +++ b/kratos/includes/define.h @@ -284,12 +284,6 @@ catch(...) { Block KRATOS_THROW_ERROR(std::runtime_error, "Unknown error", MoreI #define KRATOS_CREATE_VARIABLE(type, name) \ /*const*/ Kratos::Variable name(#name); -#ifdef KRATOS_CREATE_VARIABLE_WITH_ZERO -#undef KRATOS_CREATE_VARIABLE_WITH_ZERO -#endif -#define KRATOS_CREATE_VARIABLE_WITH_ZERO(type, name, zero) \ - /*const*/ Kratos::Variable name(#name, zero); - #ifdef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS #undef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS #endif