ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Element.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef ELEMENT_H
32#define ELEMENT_H
33
34#include <fstream>
35#include <sstream>
36#include "../Maths/Coord.h"
38#include "../Errors.h"
39#include "../Tools.h"
40#include "../Parallel/key.hpp"
41
42class Element;
43
44#include "Face.h"
45
47{
48 public:
49 Element();
50 virtual ~Element();
51
52 //Accesseurs
53 void setCellAssociee(const int& numCell) { m_numCellAssociee = numCell; };
54 const Coord& getPosition() const { return m_position; };
55 const double& getLCFL() const { return m_lCFL; };
56 const double& getVolume() const { return m_volume; };
57 const int& getNumCellAssociee() const { return m_numCellAssociee; };
58
59 virtual const int& getIndex() const
60 {
61 Errors::errorMessage("getIndex not available for requested element");
62 return Errors::defaultInt;
63 };
64 virtual const int& getAppartenancePhysique() const { return Errors::defaultInt; };
65 virtual void setVolume(const double& /*volume*/) { Errors::errorMessage("setVolume not available for requested element"); };
66 virtual void setLCFL(const double& /*lCFL*/) { Errors::errorMessage("setlCFL not available for requested element"); };
67 virtual void setPos(const double& /*X*/, const double& /*Y*/, const double& /*Z*/)
68 {
69 Errors::errorMessage("setPos not available for requested element");
70 };
71 virtual void setPos(const Coord& /*pos*/) { Errors::errorMessage("setPos not available for requested element"); };
72 virtual void setPosX(const double& /*X*/) { Errors::errorMessage("setPosX not available for requested element"); };
73 virtual void setPosY(const double& /*Y*/) { Errors::errorMessage("setPosY not available for requested element"); };
74 virtual void setPosZ(const double& /*Z*/) { Errors::errorMessage("setPosZ not available for requested element"); };
75 virtual void setSize(const double& /*sizeX*/, const double& /*sizeY*/, const double& /*sizeZ*/)
76 {
77 Errors::errorMessage("setSize not available for requested element");
78 };
79 virtual void setSize(const Coord& /*size*/) { Errors::errorMessage("setSize not available for requested element"); };
80
81 void writePos(std::ofstream& fileStream, Axis axis);
82
83 virtual void printInfo() const { Errors::errorMessage("AfficheInfos not available for requested element"); };
84
85 double distance(const Element* e);
86 double distanceX(const Element* e);
87 double distanceY(const Element* e);
88 double distanceZ(const Element* e);
89 double distance(const Face* f);
90 double distanceX(const Face* f);
91 double distanceY(const Face* f);
92 double distanceZ(const Face* f);
93
94 virtual const double& getSizeX()
95 {
96 Errors::errorMessage("getSizeX not available for requested element");
98 };
99 virtual const double& getSizeY()
100 {
101 Errors::errorMessage("getSizeY not available for requested element");
103 };
104 virtual const double& getSizeZ()
105 {
106 Errors::errorMessage("getSizeZ not available for requested element");
108 };
109 virtual const Coord& getSize()
110 {
111 Errors::errorMessage("getSize not available for requested element");
112 return Coord::defaultCoord;
113 };
114
115 bool traverseObjet(const GeometricObject& objet) const;
116
117 //Pour methode AMR
118 virtual void creerElementChild() { Errors::errorMessage("creerElementsChildren not available for requested element"); };
119 virtual Element* getElementChild(const int& /*numberChild*/)
120 {
121 Errors::errorMessage("getElementChild not available for requested element");
122 return 0;
123 };
125 {
126 Errors::errorMessage("getElementChild not available for requested element");
127 return 0;
128 };
129 virtual void finalizeElementsChildren() { Errors::errorMessage("finalizeElementsChildren not available for requested element"); };
130
131 //For parallel load balancing
132 virtual void setKey(const decomposition::Key<3>& key);
133 virtual const decomposition::Key<3>& getKey() const { return m_key; };
134
135 protected:
137 double m_volume;
138 double m_lCFL;
141};
142
143#endif // ELEMENT_H
Axis
Enumeration for the axes (X, Y and Z for the axes in the x-, y- and z-direction).
Definition Tools.h:49
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static const Coord defaultCoord
Default Coord object (const version).
Definition Coord.h:55
Definition Element.h:47
virtual ~Element()
Definition Element.cpp:39
decomposition::Key< 3 > m_key
Definition Element.h:140
int m_numCellAssociee
Definition Element.h:139
virtual const double & getSizeY()
Definition Element.h:99
virtual Element * getElementChild(const int &)
Definition Element.h:119
virtual const int & getIndex() const
Definition Element.h:59
virtual void setVolume(const double &)
default
Definition Element.h:65
void setCellAssociee(const int &numCell)
Definition Element.h:53
const double & getLCFL() const
Definition Element.h:55
double distanceX(const Element *e)
Definition Element.cpp:67
virtual void creerElementChild()
Definition Element.h:118
virtual Element * getElementChildBack()
Definition Element.h:124
const double & getVolume() const
Definition Element.h:56
virtual const int & getAppartenancePhysique() const
Definition Element.h:64
double m_lCFL
Definition Element.h:138
virtual void setKey(const decomposition::Key< 3 > &key)
Definition Element.cpp:107
virtual void setSize(const Coord &)
Definition Element.h:79
bool traverseObjet(const GeometricObject &objet) const
Definition Element.cpp:95
virtual void setSize(const double &, const double &, const double &)
Definition Element.h:75
virtual const Coord & getSize()
Definition Element.h:109
virtual void setPos(const double &, const double &, const double &)
Definition Element.h:67
double distanceZ(const Element *e)
Definition Element.cpp:75
const int & getNumCellAssociee() const
Definition Element.h:57
Element()
Definition Element.cpp:35
virtual const double & getSizeX()
Definition Element.h:94
virtual void setPos(const Coord &)
Definition Element.h:71
double distance(const Element *e)
Definition Element.cpp:63
virtual void setPosX(const double &)
Definition Element.h:72
virtual void setPosZ(const double &)
Definition Element.h:74
double m_volume
Definition Element.h:137
virtual const decomposition::Key< 3 > & getKey() const
Definition Element.h:133
virtual void setLCFL(const double &)
Definition Element.h:66
virtual void printInfo() const
Definition Element.h:83
double distanceY(const Element *e)
Definition Element.cpp:71
void writePos(std::ofstream &fileStream, Axis axis)
Definition Element.cpp:43
virtual void setPosY(const double &)
Definition Element.h:73
virtual void finalizeElementsChildren()
Definition Element.h:129
Coord m_position
Definition Element.h:136
virtual const double & getSizeZ()
Definition Element.h:104
const Coord & getPosition() const
Definition Element.h:54
static constexpr int defaultInt
Definition Errors.h:97
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
static constexpr double defaultDouble
Definition Errors.h:99
Definition Face.h:42
Abstract class for geometric object.
Definition GeometricObject.h:41
Definition key.hpp:43