Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 3 additions & 10 deletions kratos/containers/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class Variable : public VariableData
const VariableType* pTimeDerivativeVariable = nullptr
)
: VariableData(NewName, sizeof(TDataType)),
mZero(Zero),
mpTimeDerivativeVariable(pTimeDerivativeVariable)
{}
/**
Expand All @@ -102,7 +101,6 @@ class Variable : public VariableData
const VariableType* pTimeDerivativeVariable
)
: VariableData(NewName, sizeof(TDataType)),
mZero(TDataType()),
mpTimeDerivativeVariable(pTimeDerivativeVariable)
{}

Expand All @@ -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)
{}

/**
Expand All @@ -137,7 +134,6 @@ class Variable : public VariableData
const TDataType Zero = TDataType()
)
: VariableData(rNewName, sizeof(TDataType), pSourceVariable, ComponentIndex),
mZero(Zero),
mpTimeDerivativeVariable(pTimeDerivativeVariable)
{}

Expand All @@ -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
Expand Down Expand Up @@ -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

///@}
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
6 changes: 0 additions & 6 deletions kratos/includes/define.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,6 @@ catch(...) { Block KRATOS_THROW_ERROR(std::runtime_error, "Unknown error", MoreI
#define KRATOS_CREATE_VARIABLE(type, name) \
/*const*/ Kratos::Variable<type > 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<type> name(#name, zero);

#ifdef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS
#undef KRATOS_CREATE_3D_VARIABLE_WITH_THIS_COMPONENTS
#endif
Expand Down
Loading