TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Point.cpp
1/****************************************************************************
2* Copyright (c) 2024, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#include <Point.h>
17#include <Domaine.h>
18
19Implemente_instanciable_32_64(Point_32_64,"Point",Elem_geom_base_32_64<_T_>);
20// XD point points point NO_BRACE Point as class-daughter of Points.
21
22/*! @brief NE FAIT RIEN
23 *
24 * @param (Sortie& s) un flot de sortie
25 * @return (Sortie&) le flot de sortie
26 */
27template<typename _SIZE_>
29{
30 return s;
31}
32
33
34/*! @brief NE FAIT RIEN
35 *
36 * @param (Entree& s) un flot d'entree
37 * @return (Entree&) le flot d'entree
38 */
39template<typename _SIZE_>
41{
42 return s;
43}
44
45/*! @brief Renvoie le nom LML d'un triangle = "VOXEL8".
46 *
47 * @return (Nom&) toujours egal a "VOXEL8"
48 */
49template<typename _SIZE_>
51{
52 static Nom nom="POINT";
53 return nom;
54}
55
56
57/*! @brief Renvoie 1 si l'element ielem du dom associe a l'element geometrique contient le point
58 *
59 * de coordonnees specifiees par le parametre "pos".
60 * Renvoie 0 sinon.
61 *
62 * @param (DoubleVect& pos) coordonnees du point que l'on cherche a localiser
63 * @param (int element) le numero de l'element du dom dans lequel on cherche le point.
64 * @return (int) 1 si le point de coordonnees specifiees appartient a l'element "element" 0 sinon
65 */
66template<typename _SIZE_>
67int Point_32_64<_SIZE_>::contient(const ArrOfDouble& pos, int_t element ) const
68{
69 assert(pos.size_array()==this->dimension);
70
71 const Domaine_t& dom=this->mon_dom.valeur();
72 const IntTab_t& elem=dom.les_elems();
73 int ok=1;
74 for (int d=0; (d<3)&&(ok==1); d++)
75 {
76 double ps = dom.coord(elem(element,0), d);
77 double pv = pos[d];
78 if( !est_egal(ps,pv)) ok=0;
79 }
80 return ok;
81}
82
83/*! @brief Renvoie 1 si les sommets specifies par le parametre "pos" sont les sommets de l'element "element" du dom associe a
84 *
85 * l'element geometrique.
86 *
87 * @param (IntVect& pos) les numeros des sommets a comparer avec ceux de l'elements "element"
88 * @param (int element) le numero de l'element du dom dont on veut comparer les sommets
89 * @return (int) 1 si les sommets passes en parametre sont ceux de l'element specifie, 0 sinon
90 */
91template<typename _SIZE_>
93{
94 abort();
95
96 assert(pos.size_array()==1);
97 const Domaine_t& dom=this->mon_dom.valeur();
98 if((dom.sommet_elem(element,0)==pos[0])&&
99 (dom.sommet_elem(element,1)==pos[1]))
100 return 1;
101 else
102 return 0;
103}
104
105
106/*! @brief voir ElemGeomBase::get_tab_faces_sommets_locaux
107 */
108template<typename _SIZE_>
110{
111 faces_som_local.resize(1,1);
112 faces_som_local[0]=0;
113 return 1;
114}
115
116
117
118template class Point_32_64<int>;
119#if INT_is_64_ == 2
120template class Point_32_64<trustIdType>;
121#endif
122
IntTab_t & les_elems()
Definition Domaine.h:129
double coord(int_t i, int j) const
Definition Domaine.h:110
int_t sommet_elem(int_t i, int j) const
Renvoie le numero (global) du j-ieme sommet du i-ieme element.
Definition Domaine.h:136
Classe Elem_geom_base Cette classe est la classe de base pour la definition d'elements.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Classe Point Cette classe represente l'element geometrique segment.
Definition Point.h:29
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override
voir ElemGeomBase::get_tab_faces_sommets_locaux
Definition Point.cpp:109
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
Definition Point.h:37
int contient(const ArrOfDouble &pos, int_t elem) const override
Renvoie 1 si l'element ielem du dom associe a l'element geometrique contient le point.
Definition Point.cpp:67
const Nom & nom_lml() const override
Renvoie le nom LML d'un triangle = "VOXEL8".
Definition Point.cpp:50
Domaine_32_64< _SIZE_ > Domaine_t
Definition Point.h:39
IntTab_T< _SIZE_ > IntTab_t
Definition Point.h:36
_SIZE_ int_t
Definition Point.h:35
static void abort()
Routine de sortie de Trio-U sur une erreur abort().
Definition Process.cpp:570
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ size_array() const
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469