ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
ElementNS.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 ELEMENTNS_H
32#define ELEMENTNS_H
33
34#include "../../Element.h"
35
36class FaceNS; //Predeclaration de la classe Face pour pouvoir inclure Face.h
37#include "FaceNS.h"
38
39class ElementNS : public Element
40{
41 public:
42 ElementNS();
43 ElementNS(const int& typeGmsh, const int& numberNodes, const int& numberFaces, const int& typeVTK);
44 ~ElementNS() override;
45
46 void construitElement(const int* numNodes,
47 const Coord* nodes,
48 const int numberEntitePhysique,
49 const int numberEntiteGeometrique,
50 int& indexElement); /*Compute element properties*/
51
52 void construitElementParallele(const Coord* nodes); /*Compute element properties*/
53 virtual void attributFaceLimite(FaceNS** /*faces*/, const int& /*indexMaxFaces*/)
54 {
55 Errors::errorMessage("attributFaceLimite non prevu pour le type d element demande");
56 };
57 virtual void attributFaceCommunicante(FaceNS** /*faces*/, const int& /*indexMaxFaces*/, const int& /*numberNodesInternal*/)
58 {
59 Errors::errorMessage("attributFaceCommunicante non prevu pour le type d element demande");
60 };
61 virtual void construitFaces(const Coord* /*nodes*/, FaceNS** /*faces*/, int& /*indexMaxFaces*/, int** /*facesBuff*/, int* /*sumNodesBuff*/)
62 {
63 Errors::errorMessage("construitFaces non prevu pour le type d element demande");
64 }; //Pour tests
65 virtual void construitFacesSimplifie(int& /*iMax*/, int** /*facesBuff*/, int* /*sumNodesBuff*/)
66 {
67 Errors::errorMessage("construitFacesSimplifie non prevu pour le type d element demande");
68 };
69 virtual int compteFaceCommunicante(std::vector<int*>& /*faces*/, std::vector<int>& /*sumNodesBuff*/)
70 {
71 Errors::errorMessage("compteFaceCommunicante non prevu pour le type d element demande");
72 return 0;
73 };
74 virtual int compteFaceCommunicante(int& /*iMax*/, int** /*faces*/, int* /*sumNodesBuff*/)
75 {
76 Errors::errorMessage("compteFaceCommunicante non prevu pour le type d element demande");
77 return 0;
78 };
79 /* void removeCPUOthers(const int& numCPU);*/
80 void removeCPUOthers(std::vector<int>& numCPU);
81
82 //Accesseurs
83 void setIndex(int& index);
84 void setAppartenancePhysique(int& appartenancePhysique);
85 void setNumNode(int* numNodes);
86 void setNumNode(int& node, int& numNode);
87 void setIsFantome(bool isFantome);
89 void setAppartenanceCPU(const int* numCPU, const int& numberCPU);
90
91 const int& getIndex() const override { return m_index; };
92 const int& getNumberNodes() const { return m_numberNodes; };
93 const int& getNumberFaces() const { return m_numberFaces; };
94 const int& getTypeGmsh() const { return m_typeGmsh; };
95 const int& getTypeVTK() const { return m_typeVTK; };
96 const int& getNumNode(int& node) const { return m_numNodes[node]; };
97 const int& getAppartenancePhysique() const override { return m_appartenancePhysique; };
99 const int& getCPU() const { return m_CPU; };
100 const int& getNumberOthersCPU() const { return m_numberOtherCPU; };
101 const int& getAutreCPU(const int& autreCPU) const;
102 void printInfo() const override;
103
104 const bool& isFantome() const { return m_isFantome; };
105 const bool& isCommunicant() const { return m_isCommunicant; };
106
107 protected:
108 virtual void computeVolume(const Coord* /*nodes*/) {};
109 virtual void computeLCFL(const Coord* /*nodes*/) {};
110
112
121 int m_CPU; /* Index of the CPU owning the element (i.e. where the element is physically located) */
123 int* m_otherCPU; /* Indices of the CPUs on which the element is phantom (overlap) */
124 int* m_numNodes; /* Mapping with mesh nodes arrays*/
125};
126
127#endif // ELEMENTNS_H
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
virtual void construitFacesSimplifie(int &, int **, int *)
Definition ElementNS.h:65
bool m_isFantome
Definition ElementNS.h:119
void removeCPUOthers(std::vector< int > &numCPU)
Definition ElementNS.cpp:144
void setAppartenancePhysique(int &appartenancePhysique)
Definition ElementNS.cpp:107
void setIsFantome(bool isFantome)
Definition ElementNS.cpp:124
const int & getTypeGmsh() const
Definition ElementNS.h:94
int m_numberNodes
Definition ElementNS.h:115
const int & getAutreCPU(const int &autreCPU) const
Definition ElementNS.cpp:182
int m_numberFaces
Definition ElementNS.h:116
int m_numberOtherCPU
Definition ElementNS.h:122
virtual void attributFaceCommunicante(FaceNS **, const int &, const int &)
Definition ElementNS.h:57
~ElementNS() override
Definition ElementNS.cpp:53
ElementNS()
Definition ElementNS.cpp:35
virtual int compteFaceCommunicante(int &, int **, int *)
Definition ElementNS.h:74
const int & getIndex() const override
Definition ElementNS.h:91
bool m_isCommunicant
Definition ElementNS.h:120
virtual void attributFaceLimite(FaceNS **, const int &)
Definition ElementNS.h:53
int m_appartenanceGeometrique
Definition ElementNS.h:118
const int & getNumberOthersCPU() const
Definition ElementNS.h:100
const int & getCPU() const
Definition ElementNS.h:99
int m_index
Definition ElementNS.h:111
void construitElementParallele(const Coord *nodes)
Definition ElementNS.cpp:83
const bool & isCommunicant() const
Definition ElementNS.h:105
const int & getAppartenanceGeometrique() const
Definition ElementNS.h:98
int m_CPU
Definition ElementNS.h:121
const int & getNumNode(int &node) const
Definition ElementNS.h:96
virtual void computeLCFL(const Coord *)
Definition ElementNS.h:109
int * m_otherCPU
Definition ElementNS.h:123
void printInfo() const override
Definition ElementNS.cpp:192
const int & getNumberFaces() const
Definition ElementNS.h:93
const int & getAppartenancePhysique() const override
Definition ElementNS.h:97
int m_typeVTK
Definition ElementNS.h:114
virtual void computeVolume(const Coord *)
Definition ElementNS.h:108
void setIndex(int &index)
Definition ElementNS.cpp:103
void setNumNode(int *numNodes)
Definition ElementNS.cpp:111
void setAppartenanceCPU(const int *numCPU, const int &numberCPU)
Definition ElementNS.cpp:132
void setIsCommunicant(bool isCommunicant)
Definition ElementNS.cpp:128
virtual void construitFaces(const Coord *, FaceNS **, int &, int **, int *)
Definition ElementNS.h:61
const int & getNumberNodes() const
Definition ElementNS.h:92
void construitElement(const int *numNodes, const Coord *nodes, const int numberEntitePhysique, const int numberEntiteGeometrique, int &indexElement)
Definition ElementNS.cpp:61
const bool & isFantome() const
Definition ElementNS.h:104
int * m_numNodes
Definition ElementNS.h:124
virtual int compteFaceCommunicante(std::vector< int * > &, std::vector< int > &)
Definition ElementNS.h:69
int m_appartenancePhysique
Definition ElementNS.h:117
int m_typeGmsh
Definition ElementNS.h:113
const int & getTypeVTK() const
Definition ElementNS.h:95
Element()
Definition Element.cpp:35
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
Definition FaceNS.h:40