5 #ifndef TPZLADENELSONELASTICRESPONSE_H 6 #define TPZLADENELSONELASTICRESPONSE_H 27 #ifdef LOG4CXX_PLASTICITY 28 static LoggerPtr loggerPlasticity(Logger::getLogger(
"plasticity.plasticstep"));
38 int ClassId()
const override;
76 return "TPZLadeNelsonElasticResponse";
79 void Print(std::ostream & out)
const 81 out <<
"\n" << this->Name();
82 out <<
"\n fLambda = " << fLambda;
83 out <<
"\n fM = " << fM;
84 out <<
"\n fPoisson = " << fPoisson;
85 out <<
"\n fPa = " << fPa;
96 void SetUp(REAL Lambda, REAL M, REAL poisson, REAL pa)
131 template <
class T,
class TBASE>
132 void ComputeYoung(
const TPZTensor<T> & sigma, T & Young)
const;
134 template <
class T,
class TBASE>
137 template <
class T,
class VECTOR,
class MATRIX>
138 inline void ExtractTangent(
const TPZTensor<T> & Res_T, VECTOR & ResVal, REAL & resnorm, MATRIX & tangent)
const;
164 #ifdef LOG4CXX_PLASTICITY 165 LoggerPtr logger(Logger::getLogger(
"plasticity.erladenelson"));
168 for(i=0; i<6; i++) gRefDeform[i] = state(i,0);
169 #ifdef LOG4CXX_PLASTICITY 170 std::stringstream sout;
171 sout <<
"State " << state;
178 #ifdef LOG4CXX_PLASTICITY 179 LoggerPtr logger(Logger::getLogger(
"plasticity.erladenelson"));
193 gRefDeform.
CopyTo(sigma_FAD);
195 sigma_FAD[i] . diff(i,nVars);
196 tangent.
Redim(1,nVars);
197 ComputeYoung<TFAD, REAL>(sigma_FAD, young_FAD);
198 for(i=0; i<nVars; i++)
199 tangent(0,i) = young_FAD.dx(i);
203 gRefDeform.
CopyTo(epsilon_FAD);
205 epsilon_FAD[i] . diff(i,nVars);
207 ComputeStress(epsilon_FAD, sigma_FAD);
208 tangent.
Redim(nVars,nVars);
209 for(i=0; i<nVars; i++)
210 for(j=0; j<nVars; j++)
211 tangent(i,j) = sigma_FAD[i].dx(j);
214 #ifdef LOG4CXX_PLASTICITY 215 std::stringstream sout;
216 sout <<
"Matriz tangent " << tangent;
223 #ifdef LOG4CXX_PLASTICITY 224 LoggerPtr logger(Logger::getLogger(
"plasticity.erladenelson"));
236 ComputeYoung<REAL , REAL>(sigma, young);
242 gRefDeform.
CopyTo(epsilon);
244 ComputeStress(epsilon, sigma);
246 for(i=0; i<nVars; i++)
250 #ifdef LOG4CXX_PLASTICITY 251 std::stringstream sout;
252 sout <<
"Residual vector " <<
res;
267 ERLadeNelson.
SetUp(0.28 , 900. , 0.2 , 14.7);
269 Epsilon(
_XX_,0) = 0.17*0.10;
270 Epsilon(
_YY_,0) = 0.13*0.10;
271 Epsilon(
_ZZ_,0) = 0.11*0.10;
272 Epsilon(
_XY_,0) = 0.7 *0.10;
273 Epsilon(
_XZ_,0) = 0.5 *0.10;
274 Epsilon(
_YZ_,0) = 0.3 *0.10;
276 Range = Epsilon * (1./19.);
295 TFAD_SIX Young_FAD(T (0.));
298 EEpsilon_FAD(Young_FAD),
300 epsilon_FAD(Young_FAD);
302 TPZDiffMatrix<T> DResDSigma_T(nVars,nVars), Res_T(nVars,1), Sol_T(nVars, 1);
305 REAL residual, refResidual = 0.;
308 for(i = 0 ; i < nVars; i++)
310 epsilon_FAD.
fData[i].val() = epsilon_T.
fData[i];
311 sigma_FAD .fData[i].val() = sigma_T .
fData[i];
312 sigma_FAD .fData[i].diff(i,nVars);
317 ComputeYoung<TFAD_SIX, T>(sigma_FAD, Young_FAD);
318 ApplyElasticTensor<TFAD_SIX, T>(Young_FAD, epsilon_FAD, EEpsilon_FAD);
321 Res_FAD.Add(EEpsilon_FAD, T(-1.));
322 ExtractTangent(Res_FAD, Res_T, residual, DResDSigma_T);
327 status = DResDSigma_T.Substitution(& Sol_T);
329 for(i = 0; i < nVars; i++)sigma_FAD.fData[i].val() -= Sol_T(i,0);
331 ComputeYoung<TFAD_SIX,T>(sigma_FAD, Young_FAD);
332 ApplyElasticTensor<TFAD_SIX,T>(Young_FAD, epsilon_FAD, EEpsilon_FAD);
336 refResidual =
sqrt(refResidual);
339 Res_FAD.Add(EEpsilon_FAD, T(-1.));
341 ExtractTangent(Res_FAD, Res_T, residual, DResDSigma_T);
342 }
while(residual > 1.e-6 || residual/refResidual > 1.e-12);
347 for(i = 0; i < nVars; i++ )
348 sigma_T.
fData[i] = sigma_FAD.fData[i].val();
354 REAL YoungGuess = 1.e10;
356 ApplyElasticTensor<REAL, REAL>(YoungGuess, epsilon, sigma);
358 SolveSigma(epsilon, sigma);
370 epsilon_T.
CopyTo(epsilon);
372 ComputeStress(epsilon, sigma);
376 SolveSigma(epsilon_T, sigma_T);
382 template <
class T,
class TBASE>
386 REAL R = 6. * (1. + fPoisson) / (1. - 2. * fPoisson);
389 REAL pa2 = fPa * fPa;
391 T Base = (I1 * I1 + J2 * TBASE(R) ) / TBASE(pa2);
392 if((fLambda < 1E-12) )
394 Young = TBASE( fM * fPa);
397 REAL BaseParameter = 1.E-12;
408 Base = TBASE(BaseParameter);
409 #ifdef LOG4CXX_PLASTICITY 411 std::stringstream sout;
412 sout <<
"*** ComputeYoung *** Too small Elastic Modulus - Constraining it.";
413 LOGPZ_INFO(loggerPlasticity,sout.str().c_str());
419 Young = TBASE( fM * fPa ) *
exp( TBASE(fLambda) *
log( Base ) );
422 template <
class T,
class TBASE>
428 T Lambda = Young * TBASE(fPoisson/((1.+fPoisson)*(1.-2.*fPoisson)));
429 T Mu = Young / TBASE(2.*(1.+fPoisson));
430 T trace = Epsilon.
I1();
433 sigma.
Add(Epsilon,Mu * TBASE(2.));
436 template <
class T,
class VECTOR,
class MATRIX>
447 for(i=0; i<nVars; i++)
449 ResVal(i,0) = Res_T.
fData[i].val();
453 resnorm =
sqrt(resnorm);
458 for(i=0; i<nVars; i++)
459 for(j=0; j<nVars; j++)
460 tangent(i,j) = Res_T.
fData[i].dx(j);
464 #endif //TPZLADEKIMELASTICRESPONSE_H
void CheckConvergence(TConv &obj, TPZFMatrix< STATE > &state, TPZFMatrix< STATE > &range, TPZVec< REAL > &coefs)
Implements a general procedure to check whether the class TConv implements a consistente tangent matr...
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
void CopyTo(TPZTensor< T1 > &target) const
void Add(const TPZTensor< T1 > &tensor, const T2 &constant)
void Multiply(const T1 &multipl, const T2 &constant)
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
Contains TPZDiffMatrix class which to hold the flux derivatives A B C and diffusive matrix coefficien...
void SetUp(REAL Lambda, REAL M, REAL poisson, REAL pa)
void ComputeStress(const TPZTensor< T > &epsilon_T, TPZTensor< T > &sigma_T) const
TPZManVector< T, 6 > fData
void ExtractTangent(const TPZTensor< T > &Res_T, VECTOR &ResVal, REAL &resnorm, MATRIX &tangent) const
const char * Name() const
void Residual(TPZFMatrix< REAL > &res, int icase)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
TPZLadeNelsonElasticResponse(const TPZLadeNelsonElasticResponse &source)
void ComputeTangent(TPZFMatrix< REAL > &tangent, TPZVec< REAL > &, int icase)
TPZLadeNelsonElasticResponse & operator=(const TPZLadeNelsonElasticResponse &source)
#define LOGPZ_INFO(A, B)
Define log for informations.
virtual void Write(const bool val)
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
void ComputeYoung(const TPZTensor< T > &sigma, T &Young) const
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
void Read(TPZStream &buf, void *context) override
read objects from the stream
TPZLadeNelsonElasticResponse()
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
static TPZTensor< REAL > gRefDeform
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ log
void LoadState(TPZFMatrix< REAL > &state)
Matrix class to hold the flux derivatives A B C and diffusive matrix coefficients. Matrix.
Contains TPZStepSolver class which defines step solvers class.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ exp
Defines the interface for saving and reading data. Persistency.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
void Print(std::ostream &out) const
Contains the implementation of the CheckConvergence function.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
void ApplyElasticTensor(const T &Young, const TPZTensor< T > &Epsilon, TPZTensor< T > &sigma) const
void SolveSigma(const TPZTensor< T > &epsilon_T, TPZTensor< T > &sigma_T) const
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
virtual void Read(bool &val)