TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Segment_axi.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 <Segment_axi.h>
17#include <DomaineAxi1d.h>
18
19Implemente_instanciable_32_64( Segment_axi_32_64, "Segment_axi", Segment_32_64<_T_> );
20
21template <typename _SIZE_>
23{
25 return os;
26}
27
28template <typename _SIZE_>
30{
32 return is;
33}
34
35template <typename _SIZE_>
37{
38 const Domaine_t& domaine=this->mon_dom.valeur();
39 const DomaineAxi1d_32_64<_SIZE_>& dom = ref_cast(DomaineAxi1d_32_64<_SIZE_>,domaine);
40
41 int_t S1,S2;
42
43 int_t size_tot = domaine.nb_elem_tot();
44 assert(volumes.size_totale()==size_tot);
45
46 assert(dimension==3);
47
48 for (int_t num_poly=0; num_poly<size_tot; num_poly++)
49 {
50 S1 = domaine.sommet_elem(num_poly,0);
51 S2 = domaine.sommet_elem(num_poly,1);
52
53 double x0 = dom.origine_repere(num_poly,0);
54 double y0 = dom.origine_repere(num_poly,1);
55
56 double x1 = dom.coord(S1,0);
57 double x2 = dom.coord(S2,0);
58
59 double y1 = dom.coord(S1,1);
60 double y2 = dom.coord(S2,1);
61
62 double r1 = sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));
63 double r2 = sqrt((x2-x0)*(x2-x0)+(y2-y0)*(y2-y0));
64
65 volumes[num_poly]= M_PI*std::fabs(r2*r2-r1*r1);
66 }
67}
68
69
70template class Segment_axi_32_64<int>;
71#if INT_is_64_ == 2
73#endif
74
: class DomaineAxi1d
const DoubleTab_t & origine_repere()
double coord(int_t i, int j) const
Definition Domaine.h:110
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
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 Segment Cette classe represente l'element geometrique segment.
Definition Segment.h:29
: class Segment_axi
Definition Segment_axi.h:25
DoubleVect_T< _SIZE_ > DoubleVect_t
Definition Segment_axi.h:32
static int dimension
Definition Objet_U.h:99
void calculer_volumes(DoubleVect_t &) const override
Calcule les volumes des elements du domaine associe.
Domaine_32_64< _SIZE_ > Domaine_t
Definition Segment_axi.h:33
Classe de base des flux de sortie.
Definition Sortie.h:52
_SIZE_ size_totale() const
Definition TRUSTVect.tpp:61