25 static LoggerPtr logger(Logger::getLogger(
"pz.nonlinearanalysis"));
45 #ifdef PZDEBUGLINESEARCH 46 ofstream alphafile(
"c:\\Temp\\tmp\\alpha.txt");
49 REAL
error = 2.*tol+1.;
50 REAL A = 0.1, B = 2., L = 0, M = 0.;
52 REAL NormResLambda = 0., NormResMu = 0.;
62 Interval = bk; Interval -= ak;
65 while(error > tol && iter < niter){
71 lambdak = Interval; lambdak *= 0.382; lambdak += ak;
85 muk = Interval; muk *= 0.618; muk += ak;
91 if (NormResLambda > NormResMu){
96 NormResLambda = NormResMu;
104 NormResMu = NormResLambda;
108 Interval = bk; Interval -= ak; error =
Norm(Interval);
111 if(A > 1. && B > 1.)
break;
115 double ALPHA = 0.5*(A + B);
121 #ifdef PZDEBUGLINESEARCH 128 for(
int i = 0; i < alpha.
Rows(); i++){
130 alpha(i,0) = alpha(i,0)/DeltaW(i,0);
136 alphafile <<
"ALPHA = " << ALPHA <<
"\n";
143 #ifdef PZDEBUGLINESEARCH 144 alphafile <<
"ALPHA LIMIT APPLIED. Alpha = 1.\n";
160 if(prevsol.
Rows() != numeq) prevsol.
Redim(numeq,1);
168 while(error > tol && iter < numiter) {
176 const int niter = 10;
185 REAL normDeltaSol =
Norm(prevsol);
190 double norm = NormResLambda;
191 out <<
"Iteracao n : " << (iter+1) <<
" : normas |Delta(Un)| e |Delta(rhs)| : " << normDeltaSol <<
" / " << NormResLambda << endl;
194 out <<
"\nTolerancia atingida na iteracao : " << (iter+1) << endl;
195 out <<
"\n\nNorma da solucao |Delta(Un)| : " << norm << endl << endl;
198 if( (norm - error) > 1.e-9 ) {
199 out <<
"\nDivergent Method\n";
211 for(i=0;i<cap;i++) val[i] = 0.;
220 tangent.
Redim(neq,neq);
232 residual.
Redim(neq,1);
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...
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.
virtual void Solve()
Invert the stiffness matrix.
TPZFMatrix< STATE > fSolution
Solution vector.
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
REAL SolutionNorm()
Computes the L2 norm of the solution.
virtual void ComputeTangent(TPZFMatrix< STATE > &tangent, TPZVec< REAL > &coefs, int icase)
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
REAL LineSearch(const TPZFMatrix< STATE > &Wn, TPZFMatrix< STATE > DeltaW, TPZFMatrix< STATE > &NextW, REAL tol, int niter)
Implements a golden section line search.
TPZCompMesh * fCompMesh
Computational mesh.
virtual void Assemble()
Assemble the stiffness matrix and load vector.
TPZCompMesh * Mesh() const
Returns the pointer to the computational mesh.
REAL val(STATE &number)
Returns value of the variable.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
void LoadState(TPZFMatrix< STATE > &state)
Load solution with state as solution. But fSolution is not modified.
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
int Zero() override
Makes Zero all the elements.
Implements the sequence of actions to perform a finite element analysis. Analysis.
virtual void LoadSolution()
Load the solution into the computable grid.
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Free store vector implementation.
int64_t Rows() const
Returns number of rows.
virtual void LoadSolution()
Load the solution into the computable grid.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
virtual void IterativeProcess(std::ostream &out, REAL tol, int numiter, bool linesearch=false, bool checkconv=false)
It process a Newton's method to solve the non-linear problem.
TPZAutoPointer< TPZStructMatrix > fStructMatrix
Structural matrix.
virtual void AssembleResidual()
Assemble the load vector.
int NumCases()
Actually return 1.
Implements computational mesh. Computational Mesh.
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
virtual void Residual(TPZFMatrix< STATE > &residual, int icase)
int64_t NElements() const
Returns the number of elements of the vector.
void NullForce(TPZVec< REAL > &, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)
Zeroes entries of val vector and deriv matrix.
TPZFMatrix< STATE > fRhs
Load vector.
Contains the implementation of the CheckConvergence function.
TPZNonLinearAnalysis()
Default constructor.
TPZFMatrix< STATE > & Solution()
Access the solution vector.
virtual ~TPZNonLinearAnalysis()
Default destructor.
Contains TPZNonLinearAnalysis class which implements the non linear analysis.