TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Operateur_Div.h
1/****************************************************************************
2* Copyright (c) 2026, 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 Operateur_Div_included
17#define Operateur_Div_included
18
19#include <Operateur_Div_base.h>
20#include <TRUST_Deriv.h>
21#include <Operateur.h>
22
23/*! @brief Operateur_Div Generic class of the hierarchy of operators computing the divergence
24 *
25 * of a field. An Operateur_Div object can reference any object
26 * derived from Operateur_Div_base.
27 *
28 * @sa Operateur_Div_base Operateur
29 */
30class Operateur_Div : public Operateur, public OWN_PTR(Operateur_Div_base)
31{
32 Declare_instanciable(Operateur_Div);
33public :
34
35 inline Operateur_base& l_op_base() override;
36 inline const Operateur_base& l_op_base() const override;
37 DoubleTab& ajouter(const DoubleTab&, DoubleTab& ) const override;
38 DoubleTab& calculer(const DoubleTab&, DoubleTab& ) const override;
39 inline void volumique(DoubleTab& ) const;
40 void typer () override;
41 inline int op_non_nul() const override;
42
43};
44
45
46/*! @brief Returns the underlying object upcast to Operateur_base
47 *
48 * @return (Operateur_base&) the underlying object upcast to Operateur_base
49 */
51{
52 return valeur();
53}
54
55/*! @brief Returns the underlying object upcast to Operateur_base (const version)
56 *
57 * @return (Operateur_base&) the underlying object upcast to Operateur_base
58 */
60{
61 return valeur();
62}
63
64/*! @brief Initializes the array passed as parameter with the contribution of the operator.
65 *
66 * @param (DoubleTab& div) array in which the contribution of the operator is stored
67 */
68inline void Operateur_Div::volumique(DoubleTab& div) const
69{
70 valeur().volumique(div);
71}
72
73inline int Operateur_Div::op_non_nul() const
74{
75 return this->operator bool();
76}
77#endif
Operateur_Div Generic class of the hierarchy of operators computing the divergence.
Operateur_base & l_op_base() override
Returns the underlying object upcast to Operateur_base.
void typer() override
Types the operator: types as "Op_div_"+discretisation()+.
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
Initializes the array passed as parameter with the contribution of the operator.
void volumique(DoubleTab &) const
Initializes the array passed as parameter with the contribution of the operator.
int op_non_nul() const override
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
Adds the contribution of the operator to the array passed as parameter.
class Operateur_base This class is the base of the hierarchy of objects representing an
class Operateur Generic class of the operator hierarchy.
Definition Operateur.h:39