TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Tayl_Green.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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 <Tayl_Green.h>
17
18Implemente_instanciable_sans_constructeur(Tayl_Green,"Tayl_Green",TRUSTChamp_Divers_generique<Champ_Divers_Type::INUTILE>);
19// XD tayl_green champ_don_base tayl_green NO_BRACE Class Tayl_green.
20// XD attr dim entier dim REQ Dimension.
21
22
23Sortie& Tayl_Green::printOn(Sortie& os) const { return os; }
24
26{
27 is >> kwave;
28 Cerr << "kwave=" << kwave << finl;
29 return is;
30}
31
32DoubleTab& Tayl_Green::valeur_aux(const DoubleTab& positions, DoubleTab& tab_valeurs) const
33{
34 assert(tab_valeurs.size_totale() == positions.size());
35 for (int i = 0; i < tab_valeurs.dimension(0); i++)
36 {
37 tab_valeurs(i, 0) = -sin(kwave * positions(i, 0)) * cos(kwave * positions(i, 1));
38 tab_valeurs(i, 1) = cos(kwave * positions(i, 0)) * sin(kwave * positions(i, 1));
39 if (dimension == 3) tab_valeurs(i, 2) = 0.;
40 }
41 return tab_valeurs;
42}
43
44DoubleVect& Tayl_Green::valeur_aux_compo(const DoubleTab& positions, DoubleVect& tab_valeurs, int ncomp) const
45{
46 assert(tab_valeurs.size_totale() == positions.dimension(0));
47 if (ncomp == 0)
48 for (int i = 0; i < tab_valeurs.size(); i++)
49 tab_valeurs(i) = -sin(kwave * positions(i, 0)) * cos(kwave * positions(i, 1));
50 else if (ncomp == 1)
51 for (int i = 0; i < tab_valeurs.size(); i++)
52 tab_valeurs(i) = cos(kwave * positions(i, 0)) * sin(kwave * positions(i, 1));
53 else if (ncomp == 2)
54 for (int i = 0; i < tab_valeurs.size(); i++) tab_valeurs(i) = 0;
55
56 return tab_valeurs;
57}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
static int dimension
Definition Objet_U.h:94
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
Base class for output streams.
Definition Sortie.h:52
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
_SIZE_ size() const
Definition TRUSTVect.tpp:45
_SIZE_ size_totale() const
Definition TRUSTVect.tpp:61
class Tayl_Green by: buchal@che41b0.der.edf.fr
Definition Tayl_Green.h:28
DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const override
Causes an error! Must be overridden by derived classes.
DoubleVect & valeur_aux_compo(const DoubleTab &positions, DoubleVect &valeurs, int ncomp) const override
Same as valeur_aux(const DoubleTab &, DoubleTab &), but computes only the component compo of the fiel...