10 #if !defined(KRATOS_ISOTROPIC_DAMAGE_UTILITIES_H_INCLUDED)
11 #define KRATOS_ISOTROPIC_DAMAGE_UTILITIES_H_INCLUDED
38 const unsigned int VSize = InputVector.size();
39 if(rPerturbationVector.size() != VSize)
40 rPerturbationVector.
resize(VSize,
false);
42 const double MinTol = 1.0e-10;
43 const double MaxTol = 1.0e-5;
46 double max_component = fabs(InputVector[0]) , min_component = fabs(InputVector[0]);
48 for(
unsigned int i=1;
i<VSize;
i++ )
50 if( fabs(InputVector[
i]) < min_component )
52 min_component = fabs(InputVector[
i]);
54 else if( fabs(InputVector[
i]) > max_component )
56 max_component = fabs(InputVector[
i]);
60 double aux = min_component*MaxTol;
62 if( aux < (max_component*MinTol) )
64 aux = max_component*MinTol;
68 for(
unsigned int i=0;
i<VSize;
i++ )
70 if( fabs(InputVector[
i]) > 1.0e-20 )
72 rPerturbationVector[
i] = InputVector[
i]*MaxTol;
74 else if( InputVector[
i] >= 0.0 )
76 rPerturbationVector[
i] = aux;
80 rPerturbationVector[
i] = -aux;
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
Definition: isotropic_damage_utilities.hpp:21
static void ComputePerturbationVector(Vector &rPerturbationVector, const Vector &InputVector)
Definition: isotropic_damage_utilities.hpp:36
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
integer i
Definition: TensorModule.f:17