Skip to content
Snippets Groups Projects
Commit 58ae9c19 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

move dimension constant to Edge,Face,Cell. delete unused

parent 1216e6e4
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
namespace MeshLib { namespace MeshLib {
const unsigned Cell::dimension;
Cell::Cell(unsigned value, std::size_t id) Cell::Cell(unsigned value, std::size_t id)
: Element(value, id) : Element(value, id)
{ {
......
...@@ -25,6 +25,9 @@ namespace MeshLib { ...@@ -25,6 +25,9 @@ namespace MeshLib {
class Cell : public Element class Cell : public Element
{ {
public: public:
/// Constant: Dimension of this mesh element
static const unsigned dimension = 3u;
/// Get the volume of this 3d element. /// Get the volume of this 3d element.
virtual double getVolume() const { return getContent(); } virtual double getVolume() const { return getContent(); }
......
/**
* \copyright
* Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "CellRule.h"
#include "logog/include/logog.hpp"
#include "GeoLib/AnalyticalGeometry.h"
#include "MeshLib/Node.h"
#include "Face.h"
namespace MeshLib
{
const unsigned CellRule::dimension;
} // end namespace MeshLib
/**
* \copyright
* Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#ifndef CELLRULE_H_
#define CELLRULE_H_
#include "MeshLib/MeshEnums.h"
#include "Element.h"
namespace MeshLib {
/**
*/
class CellRule
{
public:
/// Constant: Dimension of this mesh element
static const unsigned dimension = 3u;
}; /* class */
} /* namespace */
#endif /* HEXRULE_H_ */
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
* *
*/ */
#include "FaceRule.h" #include "Edge.h"
namespace MeshLib { namespace MeshLib {
const unsigned FaceRule::dimension; const unsigned Edge::dimension;
} /* namespace */ } /* namespace */
...@@ -25,6 +25,9 @@ namespace MeshLib { ...@@ -25,6 +25,9 @@ namespace MeshLib {
class Edge : public Element class Edge : public Element
{ {
public: public:
/// Constant: Dimension of this mesh element
static const unsigned dimension = 1u;
/// Get the length of this 1d element. /// Get the length of this 1d element.
virtual double getLength() const { return _content; } virtual double getLength() const { return _content; }
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
namespace MeshLib { namespace MeshLib {
const unsigned Face::dimension;
Face::Face(unsigned value, std::size_t id) Face::Face(unsigned value, std::size_t id)
: Element(value, id) : Element(value, id)
{ {
......
...@@ -29,6 +29,9 @@ namespace MeshLib { ...@@ -29,6 +29,9 @@ namespace MeshLib {
class Face : public Element class Face : public Element
{ {
public: public:
/// Constant: Dimension of this mesh element
static const unsigned dimension = 2u;
/// Get the area of this 2d element. /// Get the area of this 2d element.
virtual double getArea() const { return _content; } virtual double getArea() const { return _content; }
......
...@@ -20,9 +20,6 @@ namespace MeshLib { ...@@ -20,9 +20,6 @@ namespace MeshLib {
class FaceRule class FaceRule
{ {
public: public:
/// Constant: Dimension of this mesh element
static const unsigned dimension = 2;
/// Returns the face i of the element. /// Returns the face i of the element.
static const Element* getFace(const Element* e, unsigned i) { return e->getEdge(i); } static const Element* getFace(const Element* e, unsigned i) { return e->getEdge(i); }
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "MeshLib/MeshEnums.h" #include "MeshLib/MeshEnums.h"
#include "Element.h" #include "Element.h"
#include "CellRule.h"
#include "EdgeReturn.h" #include "EdgeReturn.h"
namespace MeshLib namespace MeshLib
...@@ -43,7 +42,7 @@ namespace MeshLib ...@@ -43,7 +42,7 @@ namespace MeshLib
* *
* @endcode * @endcode
*/ */
class HexRule8 : public CellRule class HexRule8
{ {
public: public:
/// Constant: The number of base nodes for this element /// Constant: The number of base nodes for this element
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "MeshLib/MeshEnums.h" #include "MeshLib/MeshEnums.h"
#include "Element.h" #include "Element.h"
#include "CellRule.h"
#include "EdgeReturn.h" #include "EdgeReturn.h"
namespace MeshLib namespace MeshLib
...@@ -41,7 +40,7 @@ namespace MeshLib ...@@ -41,7 +40,7 @@ namespace MeshLib
* *
* @endcode * @endcode
*/ */
class PrismRule6 : public CellRule class PrismRule6
{ {
public: public:
/// Constant: The number of base nodes for this element /// Constant: The number of base nodes for this element
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "MeshLib/MeshEnums.h" #include "MeshLib/MeshEnums.h"
#include "Element.h" #include "Element.h"
#include "CellRule.h"
#include "EdgeReturn.h" #include "EdgeReturn.h"
namespace MeshLib namespace MeshLib
...@@ -40,7 +39,7 @@ namespace MeshLib ...@@ -40,7 +39,7 @@ namespace MeshLib
* @endcode * @endcode
*/ */
class PyramidRule5 : public CellRule class PyramidRule5
{ {
public: public:
/// Constant: The number of base nodes for this element /// Constant: The number of base nodes for this element
......
...@@ -18,9 +18,6 @@ const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_all_nodes; ...@@ -18,9 +18,6 @@ const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_all_nodes;
template <class T_BASE, class ELEMENT_RULE> template <class T_BASE, class ELEMENT_RULE>
const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_base_nodes; const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_base_nodes;
template <class T_BASE, class ELEMENT_RULE>
const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::dimension;
template <class T_BASE, class ELEMENT_RULE> template <class T_BASE, class ELEMENT_RULE>
TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes], unsigned value, std::size_t id) TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes], unsigned value, std::size_t id)
: T_BASE(value, id) : T_BASE(value, id)
......
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
static const unsigned n_base_nodes = ELEMENT_RULE::n_base_nodes; static const unsigned n_base_nodes = ELEMENT_RULE::n_base_nodes;
/// Constant: The dimension of this element /// Constant: The dimension of this element
static const unsigned dimension = ELEMENT_RULE::dimension; using T_BASE::dimension;
/** /**
* Constructor with an array of mesh nodes. * Constructor with an array of mesh nodes.
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "MeshLib/MeshEnums.h" #include "MeshLib/MeshEnums.h"
#include "Element.h" #include "Element.h"
#include "CellRule.h"
#include "EdgeReturn.h" #include "EdgeReturn.h"
namespace MeshLib namespace MeshLib
...@@ -38,7 +37,7 @@ namespace MeshLib ...@@ -38,7 +37,7 @@ namespace MeshLib
* *
* @endcode * @endcode
*/ */
class TetRule4 : public CellRule class TetRule4
{ {
public: public:
/// Constant: The number of base nodes for this element /// Constant: The number of base nodes for this element
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment