TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Debog.cpp
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
17#include <Champ_Inc_base.h>
18#include <Debog_Pb.h>
19#include <Debog.h>
20
21void Debog::verifier(const char* const msg, double x)
22{
23 if (Debog_Pb::get_debog_instance())
24 Debog_Pb::get_debog_instance()->verifier(msg, x);
25}
26
27void Debog::verifier(const char* const msg, int x)
28{
29 if (Debog_Pb::get_debog_instance())
30 Debog_Pb::get_debog_instance()->verifier(msg, x);
31}
32
33void Debog::verifier_bord(const char* const msg, const DoubleVect& arr, int num_deb)
34{
35 // Does nothing
36}
37
38void Debog::verifier(const char* const msg, const Champ_Inc_base& x)
39{
40 if (Debog_Pb::get_debog_instance())
41 Debog_Pb::get_debog_instance()->verifier(msg, x.valeurs());
42}
43
45{
46 if (Debog_Pb::get_debog_instance())
47 Debog_Pb::get_debog_instance()->set_nom_pb_actuel(nom);
48}
49
50/*! @brief Tests the content of the vector v assuming it contains item indices associated with the descriptor md.
51 *
52 * Example: face_keps_imposee_
53 * Negative values must be identical to the reference,
54 * non-negative values are interpreted as an index and
55 * must be equal to the reference index after renumbering.
56 *
57 */
58void Debog::verifier_indices_items(const char* const msg, const MD_Vector& md, const IntVect& v)
59{
60 // not coded
61}
62
63/*! @brief Returns 1 if we are in Debog mode, 0 otherwise.
64 *
65 */
67{
68 return bool(Debog_Pb::get_debog_instance());
69}
70
71/*! @brief like verifier(), but, in "read&compare" mode, put the reference value found in the file in the ref variable.
72 *
73 */
74void Debog::verifier_getref(const char* const msg, double x, double& ref)
75{
76 if (Debog_Pb::get_debog_instance())
77 Debog_Pb::get_debog_instance()->verifier(msg, x, &ref);
78}
79
80/*! @brief like verifier(), but, in "read&compare" mode, put the reference value found in the file in the ref variable.
81 *
82 */
83void Debog::verifier_getref(const char* const msg, int x, int& ref)
84{
85 if (Debog_Pb::get_debog_instance())
86 Debog_Pb::get_debog_instance()->verifier(msg, x, &ref);
87}
88
89void Debog::verifier(const char* const msg, const DoubleVect& x)
90{
91 if (Debog_Pb::get_debog_instance())
92 Debog_Pb::get_debog_instance()->verifier(msg, x);
93}
94
95/*! @brief like verifier(), but, in "read&compare" mode, put the reference value found in the file in the ref variable.
96 *
97 * x and ref can point to the same object.
98 *
99 */
100void Debog::verifier_getref(const char* const msg, const DoubleVect& x, DoubleVect& ref)
101{
102 if (Debog_Pb::get_debog_instance())
103 Debog_Pb::get_debog_instance()->verifier(msg, x, &ref);
104}
105
106void Debog::verifier(const char* const msg, const IntVect& x)
107{
108 if (Debog_Pb::get_debog_instance())
109 Debog_Pb::get_debog_instance()->verifier(msg, x);
110}
111
112/*! @brief like verifier(), but, in "read&compare" mode, put the reference value found in the file in the ref variable.
113 *
114 * x and ref can point to the same object.
115 *
116 */
117void Debog::verifier_getref(const char* const msg, const IntVect& x, IntVect& ref)
118{
119 if (Debog_Pb::get_debog_instance())
120 Debog_Pb::get_debog_instance()->verifier(msg, x, &ref);
121}
122
123void Debog::verifier_Mat_elems(const char* const msg, const Matrice_Base& la_matrice)
124{
125 if (Debog_Pb::get_debog_instance())
126 Debog_Pb::get_debog_instance()->verifier_Mat_elems(msg, la_matrice);
127}
Class Champ_Inc_base.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
static void verifier_bord(const char *const msg, const DoubleVect &arr, int num_deb)
Definition Debog.cpp:33
static void set_nom_pb_actuel(const Nom &nom)
Definition Debog.cpp:44
static void verifier_indices_items(const char *const msg, const MD_Vector &, const IntVect &)
Tests the content of the vector v assuming it contains item indices associated with the descriptor md...
Definition Debog.cpp:58
static void verifier_getref(const char *const msg, double val, double &refval)
like verifier(), but, in "read&compare" mode, put the reference value found in the file in the ref va...
Definition Debog.cpp:74
static int active()
Returns 1 if we are in Debog mode, 0 otherwise.
Definition Debog.cpp:66
static void verifier_Mat_elems(const char *const msg, const Matrice_Base &la_matrice)
Definition Debog.cpp:123
static void verifier(const char *const msg, double)
Definition Debog.cpp:21
: This class is an OWN_PTR but the pointed object is shared among multiple
Definition MD_Vector.h:48
Matrice_Base class - Base class of the matrix hierarchy.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31