Herezh_dev/herezh_pp/Parametres/ConstMath.cc

78 lines
2.4 KiB
C++
Raw Normal View History

// This file is part of the Herezh++ application.
//
// The finite element software Herezh++ is dedicated to the field
// of mechanics for large transformations of solid structures.
// It is developed by Gérard Rio (APP: IDDN.FR.010.0106078.000.R.P.2006.035.20600)
// INSTITUT DE RECHERCHE DUPUY DE LÔME (IRDL) <https://www.irdl.fr/>.
//
// Herezh++ is distributed under GPL 3 license ou ultérieure.
//
// Copyright (C) 1997-2021 Université Bretagne Sud (France)
// AUTHOR : Gérard Rio
// E-MAIL : gerardrio56@free.fr
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// For more information, please consult: <https://herezh.irdl.fr/>.
#include "ConstMath.h"
// def des variables static
double ConstMath::trespetit = 1.E-16;
double ConstMath::pasmalpetit = 1.E-12;
double ConstMath::petit = 1.E-10;
double ConstMath::unpeupetit = 1.E-7;
double ConstMath::unpeugrand = 1.E7;
double ConstMath::grand = 1.E10;
double ConstMath::pasmalgrand = 1.E12;
double ConstMath::tresgrand = 1.E16;
double ConstMath::Pi = 3.141592653589793238463;
double ConstMath::eps_machine = ConstMath::d_epsilon();
//******************************************************************************
//
// Purpose:
//
// D_EPSILON returns the round off unit for double precision arithmetic.
//
// Discussion:
//
// D_EPSILON is a number R which is a power of 2 with the property that,
// to the precision of the computer's arithmetic,
// 1 < 1 + R
// but
// 1 = ( 1 + R / 2 )
//
// Modified:
//
// 06 May 2003
//
// Author:
//
// John Burkardt
//
// Parameters:
//
// Output, float D_EPSILON, the floating point round-off unit.
//
double ConstMath::d_epsilon ()
{
float r = 1.0E+00;
while ( 1.0E+00 < ( double ) ( 1.0E+00 + r ) )
{r = r / 2.0E+00; };
return ( 2.0E+00 * r );
};