Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Remove Dimension #10977

Merged
merged 11 commits into from
Apr 11, 2023
3 changes: 1 addition & 2 deletions kratos/geometries/brep_curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,7 @@ GeometryData BrepCurve<TContainerPointType, TContainerPointEmbeddedType>::msGeom
{}, {}, {});

template<class TContainerPointType, class TContainerPointEmbeddedType>
const GeometryDimension BrepCurve<TContainerPointType, TContainerPointEmbeddedType>::msGeometryDimension(
1, 3, 1);
const GeometryDimension BrepCurve<TContainerPointType, TContainerPointEmbeddedType>::msGeometryDimension(3, 1);

///@}
}// namespace Kratos.
3 changes: 1 addition & 2 deletions kratos/geometries/brep_curve_on_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,7 @@ GeometryData BrepCurveOnSurface<TContainerPointType, TContainerPointEmbeddedType
{}, {}, {});

template<class TContainerPointType, class TContainerPointEmbeddedType>
const GeometryDimension BrepCurveOnSurface<TContainerPointType, TContainerPointEmbeddedType>::msGeometryDimension(
1, 3, 1);
const GeometryDimension BrepCurveOnSurface<TContainerPointType, TContainerPointEmbeddedType>::msGeometryDimension(3, 1);

///@}
}// namespace Kratos.
Expand Down
3 changes: 1 addition & 2 deletions kratos/geometries/brep_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,7 @@ GeometryData BrepSurface<TContainerPointType, TContainerPointEmbeddedType>::msGe
{}, {}, {});

template<class TContainerPointType, class TContainerPointEmbeddedType>
const GeometryDimension BrepSurface<TContainerPointType, TContainerPointEmbeddedType>::msGeometryDimension(
2, 3, 2);
const GeometryDimension BrepSurface<TContainerPointType, TContainerPointEmbeddedType>::msGeometryDimension(3, 2);

///@}
}// namespace Kratos.
Expand Down
28 changes: 7 additions & 21 deletions kratos/geometries/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -1277,19 +1277,6 @@ class Geometry
///@name Informations
///@{

/** Dimension of the geometry for example a triangle2d is a 2
dimensional shape

@return SizeType, dimension of this geometry.
@see WorkingSpaceDimension()
@see LocalSpaceDimension()
*/
KRATOS_DEPRECATED_MESSAGE("'Dimension' is deprecated. Use either 'WorkingSpaceDimension' or 'LocalSpaceDimension' instead.")
inline SizeType Dimension() const
{
return mpGeometryData->Dimension();
}

/** Working space dimension. for example a triangle is a 2
dimensional shape but can be used in 3 dimensional space.

Expand Down Expand Up @@ -1347,8 +1334,8 @@ class Geometry
return 0.0;
}

/**
* @brief This method calculate and return area or surface area of this geometry depending to it's dimension.
/**
* @brief This method calculate and return area or surface area of this geometry depending to it's dimension.
* @details For one dimensional geometry it returns length, for two dimensional it gives area and for three dimensional geometries it gives surface area.
* @return double value contains area or surface area.
* @see Length()
Expand All @@ -1360,8 +1347,8 @@ class Geometry
return 0.0;
}

/**
* @brief This method calculate and return volume of this geometry.
/**
* @brief This method calculate and return volume of this geometry.
* @details For one and two dimensional geometry it returns zero and for three dimensional it gives volume of geometry.
* @return double value contains volume.
* @see Length()
Expand All @@ -1373,8 +1360,8 @@ class Geometry
return 0.0;
}

/**
* @brief This method calculate and return length, area or volume of this geometry depending to it's dimension.
/**
* @brief This method calculate and return length, area or volume of this geometry depending to it's dimension.
* @details For one dimensional geometry it returns its length, for two dimensional it gives area and for three dimensional geometries it gives its volume.
* @return double value contains length, area or volume.
* @see Length()
Expand Down Expand Up @@ -4296,7 +4283,6 @@ inline std::ostream& operator << ( std::ostream& rOStream,
///@}

template<class TPointType>
const GeometryDimension Geometry<TPointType>::msGeometryDimension(
3, 3, 3);
const GeometryDimension Geometry<TPointType>::msGeometryDimension(3, 3);

} // namespace Kratos.
13 changes: 0 additions & 13 deletions kratos/geometries/geometry_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,19 +364,6 @@ class GeometryData
///@name Informations
///@{

/** Dimension of the geometry for example a triangle2d is a 2
dimensional shape

@return SizeType, dimension of this geometry.
@see WorkingSpaceDimension()
@see LocalSpaceDimension()
*/
KRATOS_DEPRECATED_MESSAGE("'Dimension' is deprecated. Use either 'WorkingSpaceDimension' or 'LocalSpaceDimension' instead.")
SizeType Dimension() const
{
return mpGeometryDimension->Dimension();
}

/** Working space dimension. for example a triangle is a 2
dimensional shape but can be used in 3 dimensional space.

Expand Down
31 changes: 5 additions & 26 deletions kratos/geometries/geometry_dimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ class GeometryDimension
for example a triangle is a 2 dimensional shape but
can have 3 dimensional area coordinates l1, l2, l3.
*/
GeometryDimension( SizeType ThisDimension,
SizeType ThisWorkingSpaceDimension,
SizeType ThisLocalSpaceDimension )
: mDimension( ThisDimension )
, mWorkingSpaceDimension( ThisWorkingSpaceDimension )
GeometryDimension(
SizeType ThisWorkingSpaceDimension,
SizeType ThisLocalSpaceDimension )
: mWorkingSpaceDimension( ThisWorkingSpaceDimension )
, mLocalSpaceDimension( ThisLocalSpaceDimension )
{
}
Expand All @@ -81,8 +80,7 @@ class GeometryDimension
Construct this geometry data as a copy of given geometry data.
*/
GeometryDimension( const GeometryDimension& rOther )
: mDimension( rOther.mDimension )
, mWorkingSpaceDimension( rOther.mWorkingSpaceDimension )
: mWorkingSpaceDimension( rOther.mWorkingSpaceDimension )
, mLocalSpaceDimension( rOther.mLocalSpaceDimension )
{
}
Expand All @@ -96,7 +94,6 @@ class GeometryDimension

GeometryDimension& operator=( const GeometryDimension& rOther )
{
mDimension = rOther.mDimension;
mWorkingSpaceDimension = rOther.mWorkingSpaceDimension;
mLocalSpaceDimension = rOther.mLocalSpaceDimension;

Expand All @@ -107,20 +104,6 @@ class GeometryDimension
///@name Informations
///@{

/** Dimension of the geometry for example a triangle2d is a 2
dimensional shape. A line is 1 dimensional shape and
a point 0 dimensional.

@return SizeType, dimension of this geometry.
@see WorkingSpaceDimension()
@see LocalSpaceDimension()
*/
KRATOS_DEPRECATED_MESSAGE("'Dimension' is deprecated. Use either 'WorkingSpaceDimension' or 'LocalSpaceDimension' instead.")
inline SizeType Dimension() const
{
return mDimension;
}

/** Working space dimension. for example a triangle as part
of a surface is a 2 dimensional shape but can be used in
3 dimensional space.
Expand Down Expand Up @@ -176,8 +159,6 @@ class GeometryDimension
///@name Member Variables
///@{

SizeType mDimension;

SizeType mWorkingSpaceDimension;

SizeType mLocalSpaceDimension;
Expand All @@ -190,14 +171,12 @@ class GeometryDimension

virtual void save( Serializer& rSerializer ) const
{
rSerializer.save( "Dimension", mDimension );
rSerializer.save( "WorkingSpaceDimension", mWorkingSpaceDimension );
rSerializer.save( "LocalSpaceDimension", mLocalSpaceDimension );
}

virtual void load( Serializer& rSerializer )
{
rSerializer.load( "Dimension", mDimension );
rSerializer.load( "WorkingSpaceDimension", mWorkingSpaceDimension );
rSerializer.load( "LocalSpaceDimension", mLocalSpaceDimension );
}
Expand Down
7 changes: 3 additions & 4 deletions kratos/geometries/hexahedra_3d_20.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ template<class TPointType> class Hexahedra3D20 : public Geometry<TPointType>

}

/**
* @brief This method calculate and return volume of this geometry.
/**
* @brief This method calculate and return volume of this geometry.
* @details For one and two dimensional geometry it returns zero and for three dimensional it gives volume of geometry.
* @return double value contains volume.
* @see Length()
Expand Down Expand Up @@ -1606,7 +1606,6 @@ GeometryData Hexahedra3D20<TPointType>::msGeometryData(
);

template<class TPointType> const
GeometryDimension Hexahedra3D20<TPointType>::msGeometryDimension(
3, 3, 3);
GeometryDimension Hexahedra3D20<TPointType>::msGeometryDimension(3, 3);

}// namespace Kratos.
9 changes: 4 additions & 5 deletions kratos/geometries/hexahedra_3d_27.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Josep Maria Carbonell
//

#pragma once
#pragma once

// System includes

Expand Down Expand Up @@ -465,8 +465,8 @@ template<class TPointType> class Hexahedra3D27 : public Geometry<TPointType>
return Volume();
}

/**
* @brief This method calculate and return volume of this geometry.
/**
* @brief This method calculate and return volume of this geometry.
* @details For one and two dimensional geometry it returns zero and for three dimensional it gives volume of geometry.
* @return double value contains volume.
* @see Length()
Expand Down Expand Up @@ -1478,7 +1478,6 @@ GeometryData Hexahedra3D27<TPointType>::msGeometryData(
);

template<class TPointType>
const GeometryDimension Hexahedra3D27<TPointType>::msGeometryDimension(
3, 3, 3);
const GeometryDimension Hexahedra3D27<TPointType>::msGeometryDimension(3, 3);

}// namespace Kratos.
19 changes: 9 additions & 10 deletions kratos/geometries/hexahedra_3d_8.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
return Volume();
}

/**
* @brief This method calculate and return volume of this geometry.
/**
* @brief This method calculate and return volume of this geometry.
* @details For one and two dimensional geometry it returns zero and for three dimensional it gives volume of geometry.
* @return double value contains volume.
* @see Length()
Expand Down Expand Up @@ -579,7 +579,7 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
* @return double value with the average edge length
*
*/
double AverageEdgeLength() const override
double AverageEdgeLength() const override
{
const TPointType& p0 = this->GetPoint(0);
const TPointType& p1 = this->GetPoint(1);
Expand Down Expand Up @@ -690,7 +690,7 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
return false;
}

/**
/**
* @brief Implements the calculus of the 8 solid angles of the hexa
* @details Implements the calculus of the 8 solid angles of the hexa
* @param rSolidAngles The solid angles of the geometry
Expand All @@ -712,7 +712,7 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
}
}

/**
/**
* @brief Implements the calculus of the 24 dihedral angles of the hexa
* @details Implements the calculus of the 24 dihedral angles of the hexa.
* Each edge has two different dihedral angles in each extreme.
Expand Down Expand Up @@ -746,7 +746,7 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
}
}

/**
/**
* @brief Calculates the min dihedral angle quality metric.
* @details Calculates the min dihedral angle quality metric.
* The min dihedral angle is min angle between two faces of the element
Expand All @@ -763,7 +763,7 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
return min_dihedral_angle;
}

/**
/**
* @brief Calculates the max dihedral angle quality metric.
* @details Calculates the max dihedral angle quality metric.
* The max dihedral angle is max angle between two faces of the element
Expand Down Expand Up @@ -804,7 +804,7 @@ template<class TPointType> class Hexahedra3D8 : public Geometry<TPointType>
return Volume() / std::pow(rms_edge, 3.0);
}

/**
/**
* @brief Calculates the shortest to longest edge quality metric.
* Calculates the shortest to longest edge quality metric.
* This metric is bounded by the interval (0,1) being:
Expand Down Expand Up @@ -1441,7 +1441,6 @@ GeometryData Hexahedra3D8<TPointType>::msGeometryData(
);

template<class TPointType> const
GeometryDimension Hexahedra3D8<TPointType>::msGeometryDimension(
3, 3, 3);
GeometryDimension Hexahedra3D8<TPointType>::msGeometryDimension(3, 3);

}// namespace Kratos.
3 changes: 1 addition & 2 deletions kratos/geometries/hexahedra_interface_3d_8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1837,8 +1837,7 @@ GeometryData HexahedraInterface3D8<TPointType>::msGeometryData(
);

template<class TPointType>
const GeometryDimension HexahedraInterface3D8<TPointType>::msGeometryDimension(
3, 3, 3);
const GeometryDimension HexahedraInterface3D8<TPointType>::msGeometryDimension(3, 3);

}// namespace Kratos.

Expand Down
3 changes: 1 addition & 2 deletions kratos/geometries/line_2d_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,6 @@ const GeometryData Line2D2<TPointType>::msGeometryData(
AllShapeFunctionsLocalGradients() );

template<class TPointType>
const GeometryDimension Line2D2<TPointType>::msGeometryDimension(
2, 2, 1);
const GeometryDimension Line2D2<TPointType>::msGeometryDimension(2, 1);

} // namespace Kratos.
3 changes: 1 addition & 2 deletions kratos/geometries/line_2d_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,6 @@ const GeometryData Line2D3<TPointType>::msGeometryData(
AllShapeFunctionsLocalGradients() );

template<class TPointType>
const GeometryDimension Line2D3<TPointType>::msGeometryDimension(
2, 2, 1);
const GeometryDimension Line2D3<TPointType>::msGeometryDimension(2, 1);

} // namespace Kratos.
Loading