TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Periodique.h
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#ifndef Periodique_included
17#define Periodique_included
18
19#include <Cond_lim_base.h>
20#include <TRUSTTab.h>
21
22/*! @brief class Periodique This class represents a periodic boundary condition.
23 *
24 * Periodicity can be specified in X, Y or Z.
25 * All faces of the boundary associated with this condition must
26 * have the same orientation.
27 *
28 * @sa Cond_lim_base, All faces of the boundary associated with this condition must have the same orientation
29 */
31{
32 Declare_instanciable(Periodique);
33public:
34 void mettre_a_jour(double temps) override { }
35 int face_associee(int i) const { return face_front_associee_[i]; }
36 inline const ArrOfInt& face_associee() const { return face_front_associee_; }
37 double distance() const { return distance_; }
38 inline const ArrOfDouble& direction_perio() const { return direction_perio_; }
39 int direction_periodicite() const;
40 inline int est_periodique_selon_un_axe() const { return direction_xyz_ >= 0; }
41
42protected:
43 // Array of size nb_faces() + nb_faces_virt()
44 // face_front_associee_[i] is the index of the opposite face on this boundary (-1 if the opposite face does not exist for a virtual face)
46 ArrOfDouble direction_perio_;
47 double distance_ = -500.;
48 // -1, 0, 1, or 2
49 int direction_xyz_ = -100;
50 int compatible_avec_eqn(const Equation_base&) const override { return 1; }
51 void completer() override;
52};
53
54#endif
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
class Equation_base The role of an equation is the calculation of one or more fields....
class Periodique This class represents a periodic boundary condition.
Definition Periodique.h:31
void completer() override
DOES NOTHING must be overridden in derived classes.
double distance_
Definition Periodique.h:47
const ArrOfInt & face_associee() const
Definition Periodique.h:36
ArrOfDouble direction_perio_
Definition Periodique.h:46
double distance() const
Definition Periodique.h:37
int face_associee(int i) const
Definition Periodique.h:35
int compatible_avec_eqn(const Equation_base &) const override
Definition Periodique.h:50
void mettre_a_jour(double temps) override
Performs a time update of the boundary condition.
Definition Periodique.h:34
int est_periodique_selon_un_axe() const
Definition Periodique.h:40
ArrOfInt face_front_associee_
Definition Periodique.h:45
int direction_periodicite() const
const ArrOfDouble & direction_perio() const
Definition Periodique.h:38
int direction_xyz_
Definition Periodique.h:49