NuTo
Numerics Tool
Tetrahedron.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Shape.h"
4 
5 namespace NuTo
6 {
7 
8 class Tetrahedron : public Shape
9 {
10 public:
11  eShape Enum() const override
12  {
13  return eShape::Tetrahedron;
14  }
15 
16  bool IsWithinShape(Eigen::VectorXd xi, double e = 1e-8) const override
17  {
18  double x = xi[0];
19  double y = xi[1];
20  double z = xi[2];
21  return (0.-e < x) && (x < 1.+e) && (0.-e < y) && (y < 1.+e) && (0.-e < z) && (z < 1.+e) && (x+y+z < 1.+e);
22  }
23 
24 protected:
25  void Info(std::ostream& out) const override
26  {
27  out << "Tetrahedron";
28  }
29 };
30 
31 } // namespace NuTo
bool IsWithinShape(Eigen::VectorXd xi, double e=1e-8) const override
Definition: Tetrahedron.h:16
void Info(std::ostream &out) const override
Definition: Tetrahedron.h:25
eShape Enum() const override
Definition: Tetrahedron.h:11
eShape
Definition: Shape.h:9
Definition: Shape.h:20
Definition: Tetrahedron.h:8
Definition: Exception.h:6