11 #include <__functional_base> 56 static LoggerPtr logger(Logger::getLogger(
"pz.analysis"));
57 static LoggerPtr loggerError(Logger::getLogger(
"pz.analysis.error"));
66 #define RENUMBER TPZSloanRenumbering() 72 #define RENUMBER TPZSloanRenumbering() 86 fGeoMesh(0), fCompMesh(0), fRhs(), fSolution(), fSolver(0), fStep(0), fTime(0.), fNthreadsError(0),fStructMatrix(0), fRenumber(new
RENUMBER)
87 , fGuiInterface(NULL), fTable(), fExact(NULL) {
96 fGeoMesh(0),
fCompMesh(0),
fRhs(),
fSolution(),
fSolver(0),
fStep(0),
fTime(0.),
fNthreadsError(0),
fStructMatrix(0),
fRenumber(new
RENUMBER),
fGuiInterface(NULL),
fTable(),
fExact(NULL)
106 fGeoMesh(0),
fCompMesh(0),
fRhs(),
fSolution(),
fSolver(0),
fStep(0),
fTime(0.),
fNthreadsError(0),
fStructMatrix(0),
fRenumber(new
RENUMBER),
fGuiInterface(NULL),
fTable(),
fExact(NULL)
111 this->
SetCompMesh(mesh.operator ->(), mustOptimizeBandwidth);
126 if(neq > 20000 && mustOptimizeBandwidth)
128 std::cout << __PRETTY_FUNCTION__ <<
" optimizing bandwidth\n";
131 if(mustOptimizeBandwidth)
135 if(neq > 20000 && mustOptimizeBandwidth)
137 std::cout << __PRETTY_FUNCTION__ <<
" optimizing bandwidth finished\n";
178 for(dim=0; dim<3; dim++) {
206 int64_t nel = elgraphindex.
NElements()-1;
221 if(nindep == 0)
return;
224 int64_t nel = elgraphindex.
NElements()-1;
227 for(el = 0; el<ncel; el++)
231 std::set<int64_t> indepconlist,depconlist;
233 int64_t locnindep = indepconlist.size();
234 maxelcon = maxelcon < locnindep ? locnindep : maxelcon;
239 if(logger->isDebugEnabled())
241 std::stringstream sout;
242 fRenumber->
Print(elgraph, elgraphindex,
"Elgraph of submesh", sout);
249 std::cout <<
"Applying Saddle Permute\n";
270 std::map<int, TPZMaterial *>::iterator it;
276 res = res < matnumstate ? matnumstate :
res;
291 if(
Mesh()->NEquations()==0)
293 cout <<
"\n ########################################################################" <<endl;
294 cout <<
"\n Imprimindo malha computacional de pos processamento no assemble residual " <<endl;
295 cout <<
"\n Malha nula! " <<endl;
308 std::stringstream sout;
309 sout <<
"TPZAnalysis::Assemble lacking definition for Assemble fCompMesh "<< (
void *)
fCompMesh 311 <<
" fSolver " << (
void *)
fSolver;
313 sout <<
" at file " << __FILE__ <<
" line " << __LINE__ ;
315 sout <<
" TPZAnalysis::Assemble() " ;
320 std::cout << sout.str().c_str() << std::endl;
340 if(logger->isDebugEnabled())
342 std::stringstream sout;
359 if (nReducedEq == numeq)
366 if (logger->isDebugEnabled())
370 std::stringstream sout;
371 sout <<
"Residual norm " <<
Norm(res2) << std::endl;
385 if (logger->isDebugEnabled())
391 std::stringstream sout;
392 sout <<
"Residual norm " <<
Norm(res2) << std::endl;
410 std::stringstream sout;
413 int64_t nsing = step->
Singular().size();
414 if(nsing && logger->isWarnEnabled()) {
415 sout <<
"Number of singular equations " << nsing;
416 std::list<int64_t>::iterator it = step->
Singular().begin();
417 if(nsing) sout <<
"\nSingular modes ";
423 if(nsing) sout << std::endl;
428 if (logger->isDebugEnabled())
430 std::stringstream sout;
448 out<<endl<<name<<endl;
450 out <<
"No computational mesh\n";
455 for(i=0;i<nelements;i++) {
458 out <<
"Connect index " << i << endl;
498 for(
int ier = 0; ier < errors.
NElements(); ier++) values[ier] += errors[ier] * errors[ier];
502 for(
int ier = 0; ier < errors.
NElements(); ier++) values2[ier] += errors[ier] * errors[ier];
513 out << endl <<
"############" << endl;
514 out << endl <<
"L2 Norm for pressure = " <<
sqrt(values2[0]) << endl;
515 out << endl <<
"L2 Norm for flux = " <<
sqrt(values2[1]) << endl;
516 out << endl <<
"L2 Norm for divergence = " <<
sqrt(values2[2]) <<endl;
517 out << endl <<
"Hdiv Norm for flux = " <<
sqrt(values2[3]) <<endl;
519 out << endl <<
"############" << endl;
520 out << endl <<
"true_error (Norma H1) = " <<
sqrt(values[0]) << endl;
521 out << endl <<
"L2_error (Norma L2) = " <<
sqrt(values[1]) << endl;
522 out << endl <<
"estimate (Semi-norma H1) = " <<
sqrt(values[2]) <<endl;
525 out << endl <<
"############" << endl;
526 out << endl <<
"L2 Norm for pressure = " <<
sqrt(values[0]) << endl;
527 out << endl <<
"L2 Norm for flux = " <<
sqrt(values[1]) << endl;
528 out << endl <<
"L2 Norm for divergence = " <<
sqrt(values[2]) <<endl;
529 out << endl <<
"Hdiv Norm for flux = " <<
sqrt(values[3]) <<endl;
531 out << endl <<
"############" << endl;
532 out << endl <<
"true_error (Norma H1) = " <<
sqrt(values2[0]) << endl;
533 out << endl <<
"L2_error (Norma L2) = " <<
sqrt(values2[1]) << endl;
534 out << endl <<
"estimate (Semi-norma H1) = " <<
sqrt(values2[2]) <<endl;
539 out << endl <<
"############" << endl;
540 out << endl <<
"L2 Norm for pressure = " <<
sqrt(values[0]) << endl;
541 out << endl <<
"L2 Norm for flux = " <<
sqrt(values[1]) << endl;
542 out << endl <<
"L2 Norm for divergence = " <<
sqrt(values[2]) <<endl;
543 out << endl <<
"Hdiv Norm for flux = " <<
sqrt(values[3]) <<endl;
545 out << endl <<
"############" << endl;
546 out << endl <<
"true_error (Norma H1) = " <<
sqrt(values2[0]) << endl;
547 out << endl <<
"L2_error (Norma L2) = " <<
sqrt(values2[1]) << endl;
548 out << endl <<
"estimate (Semi-norma H1) = " <<
sqrt(values2[2]) <<endl;
551 out << endl <<
"############" << endl;
552 out << endl <<
"L2 Norm for pressure = " <<
sqrt(values2[0]) << endl;
553 out << endl <<
"L2 Norm for flux = " <<
sqrt(values2[1]) << endl;
554 out << endl <<
"L2 Norm for divergence = " <<
sqrt(values2[2]) <<endl;
555 out << endl <<
"Hdiv Norm for flux = " <<
sqrt(values2[3]) <<endl;
557 out << endl <<
"############" << endl;
558 out << endl <<
"true_error (Norma H1) = " <<
sqrt(values[0]) << endl;
559 out << endl <<
"L2_error (Norma L2) = " <<
sqrt(values[1]) << endl;
560 out << endl <<
"estimate (Semi-norma H1) = " <<
sqrt(values[2]) <<endl;
563 for(i=0;i<nerrors;i++) {
564 ervec[i] =
sqrt(values[i]);
566 for(i=nerrors;i<2*nerrors;i++){
567 ervec[i] =
sqrt(values2[i-nerrors]);
583 #include "boost/date_time/posix_time/posix_time.hpp" 590 const int64_t ncompel = elvec.
NElements();
591 elvecToComputeError.
Resize(ncompel);
593 int64_t nelToCompute = 0;
600 elvecToComputeError[nelToCompute] = el;
606 elvecToComputeError.
Resize(nelToCompute);
618 const int64_t myid = data->
ftid;
630 if ( iel >= nelem )
continue;
641 for(
int ier = 0; ier < nerrors; ier++)
643 (data->
fvalues[myid])[ier] += errors[ier] * errors[ier];
661 boost::posix_time::ptime tsim1 = boost::posix_time::microsec_clock::local_time();
665 boost::posix_time::ptime tsim2 = boost::posix_time::microsec_clock::local_time();
666 std::cout <<
"Total wall time of CreateListOfCompElsToComputeError = " << tsim2 - tsim1 <<
" s" << std::endl;
678 boost::posix_time::ptime tthread1 = boost::posix_time::microsec_clock::local_time();
692 boost::posix_time::ptime tthread2 = boost::posix_time::microsec_clock::local_time();
693 std::cout <<
"Total wall time of ThreadWork = " << tthread2 - tthread1 <<
" s" << std::endl;
698 if(threaddata.
ftid != numthreads){
709 for(
int ir = 0 ; ir < nerrors ; ir++){
710 values[ir] += (threaddata.
fvalues[it])[ir];
719 PZError << endl <<
"TPZAnalysis::PostProcess - At least 3 norms are expected." << endl;
720 out<<endl<<
"############"<<endl;
723 for(
int ier = 0; ier < nerrors; ier++)
724 out << endl <<
"error " << ier <<
" = " <<
sqrt(values[ier]);
729 out <<
"############" << endl;
730 out <<
"Norma H1 or L2 -> p = " <<
sqrt(values[0]) << endl;
731 out <<
"Norma L2 or L2 -> u = " <<
sqrt(values[1]) << endl;
732 out <<
"Semi-norma H1 or L2 -> div = " <<
sqrt(values[2]) <<endl;
733 for(
int ier = 3; ier < nerrors; ier++)
734 out <<
"other norms = " <<
sqrt(values[ier]) << endl;
739 for(
int i=0;i<nerrors;i++)
740 ervec[i] =
sqrt(values[i]);
773 values.
Resize(nerrors, 0.);
774 elvalues.
Resize(nelgeom,nerrors);
775 for(
int ier = 0; ier < nerrors; ier++)
781 values[ier] += errors[ier] * errors[ier];
794 PZError << endl <<
"TPZAnalysis::PostProcess - At least 3 norms are expected." << endl;
795 out<<endl<<
"############"<<endl;
796 for(
int ier = 0; ier < nerrors; ier++)
797 out << endl <<
"error " << ier <<
" = " <<
sqrt(values[ier]);
801 out <<
"############" << endl;
802 out <<
"Norma H1 or L2 -> p = " <<
sqrt(values[0]) << endl;
803 out <<
"Norma L2 or L2 -> u = " <<
sqrt(values[1]) << endl;
804 out <<
"Semi-norma H1 or L2 -> div = " <<
sqrt(values[2]) <<endl;
805 for(
int ier = 3; ier < nerrors; ier++)
806 out <<
"other norms = " <<
sqrt(values[ier]) << endl;
810 if(loggerError->isDebugEnabled())
812 std::stringstream sout;
818 for(i=0;i<nerrors;i++)
819 ervec[i] =
sqrt(values[i]);
827 for(int64_t i=0;i<nel;i++) {
842 scalnames.
Push(
"Solution");
846 vecnames.
Push(
"Solution");
851 int neq = equationindices.
size();
854 for (
int ieq = 0; ieq < neq; ieq++) {
870 int n_varnames = varname.
size();
872 for(
int i_var = 0 ; i_var<n_varnames ; i_var++){
879 scalnames.
Push(varname[i_var]);
883 vecnames.
Push(varname[i_var]);
890 int neq = equationindices.
size();
893 for (
int ieq = 0; ieq < neq; ieq++) {
917 #include "boost/date_time/posix_time/posix_time.hpp" 926 std::cout <<
"Entering Assemble Equations\n";
930 boost::posix_time::ptime t1 = boost::posix_time::microsec_clock::local_time();
936 std::cout <<
"Entering Solve\n";
941 boost::posix_time::ptime t2 = boost::posix_time::microsec_clock::local_time();
946 boost::posix_time::ptime t3 = boost::posix_time::microsec_clock::local_time();
947 std::cout <<
"Time for assembly " << t2-t1 <<
" Time for solving " << t3-t2 << std::endl;
953 std::set<int> matids;
955 this->
DefineGraphMesh(dimension, matids, scalnames, vecnames, plotfile);
960 std::set<int> matids;
962 this->
DefineGraphMesh(dimension, matids, scalnames, vecnames, tensnames, plotfile);
969 cout <<
"TPZAnalysis::DefineGraphMesh nothing to post-process\n";
976 int posplot = plotfile.rfind(
".plt");
977 int64_t filelength = plotfile.
size();
978 if (filelength - posplot == 3) {
979 if(tensnames.
size() != 0)
981 std::cout <<
"Tensors are not beint post-process for file = " << plotfile << std::endl;
985 int posdx = plotfile.rfind(
".dx");
986 if (filelength - posdx == 3) {
987 if(tensnames.
size() != 0) {
988 std::cout <<
"Tensors are not beint post-process for file = " << plotfile << std::endl;
993 int pospos = plotfile.rfind(
".pos");
994 if (filelength - pospos == 3) {
995 if(tensnames.
size() != 0) {
996 std::cout <<
"Tensors are not beint post-process for file = " << plotfile << std::endl;
1000 int posvtk = plotfile.rfind(
".vtk");
1001 if (filelength - posvtk == 4) {
1004 cout <<
"grafgrid was not created\n";
1017 this->
DefineGraphMesh(dim,matids, scalnames, vecnames, tensnames, plotfile);
1023 for(
int i = 0; i < 3; i++){
1033 for(dim=1; dim<=3; dim++) {
1040 std::map<int, TPZMaterial * >::iterator matit;
1047 matids.insert(mat->
Id());
1050 if (matids.size() == 0) {
1051 std::cout << __PRETTY_FUNCTION__ <<
" No materials were identified to perform post-processing. \n";
1058 int dim1 = dimension-1;
1077 std::set<int> matids;
1085 for(i=1; i<=num_iter;i+=steps){
1101 std::map<int, TPZMaterial * >::iterator matit;
1104 if(!matit->second)
continue;
1105 dim = matit->second->Dimension() > dim ? matit->second->Dimension() : dim;
1111 fGeoElId(), fCompElPtr(), fDimension(-1), fLocations(), fVariableNames() {
1115 return Hash(
"TPZAnalysis::TTablePostProcess");
1146 for(iel=0; iel<
numel; iel++) {
1159 for(
int iv=0; iv<numvar; iv++) {
1161 for(int64_t iel=0; iel<
numel; iel++) {
1170 for(
int iv=0; iv<numvar; iv++) {
1172 for(int64_t iel=0; iel<
numel; iel++) {
1189 for(
int iv=0; iv<numvar; iv++) {
1191 for(int64_t iel=0; iel<
numel; iel++) {
1212 cout << __FUNCTION__ <<
" called with uninitialized stiffness matrix\n";
1214 cout <<
"TPZMatrixSolver *TPZAnalysis::BuildPreconditioner" <<
" called with uninitialized stiffness matrix\n";
1228 int64_t nel = elementgraphindex.
NElements()-1;
1234 switch(preconditioner)
1253 if (logger->isDebugEnabled())
1255 std::map<int64_t,int64_t> blocksizes;
1257 int64_t totalsize = 0;
1258 for(i=0; i< expblockgraphindex.
NElements()-1;i++)
1260 int64_t bls = expblockgraphindex[i+1]-expblockgraphindex[i];
1262 totalsize += bls*bls;
1264 std::map<int64_t,int64_t>::iterator it;
1265 std::stringstream sout;
1266 sout << __PRETTY_FUNCTION__ <<
" total size of allocation " << totalsize << std::endl;
1267 for(it=blocksizes.begin(); it != blocksizes.end(); it++)
1269 sout <<
"block size " << (*it).first <<
" number of blocks " << (*it).second << std::endl;
1279 step->SetDirect(
ELU);
1295 int numcolors = nodeset.
ColorGraph(expblockgraph,expblockgraphindex,neq,blockcolor);
1308 for(c=0; c<numcolors; c++)
1312 steps[c]->SetDirect(
ELU);
1315 if(numcolors == 1)
return steps[0];
1318 for(c=numcolors-1; c>=0; c--)
1322 for(c=1; c<numcolors; c++)
1324 steps[c]->SetReferenceMatrix(0);
1327 for(c=0; c<numcolors; c++)
1338 std::map<int,int> variableids;
1341 std::map<int,TPZMaterial *>::iterator itmap;
1343 if (matids.find(itmap->first) != matids.end()) {
1344 variableids[itmap->first] = itmap->second->VariableIndex(varname);
1345 nvars = itmap->second->NSolutionVariables(variableids[itmap->first]);
1350 for (int64_t el=0; el<nelem; el++) {
1360 if (matids.find(matid) == matids.end()) {
1365 for (
int iv=0; iv<nvars; iv++)
1367 result[iv] += locres[iv];
1376 int64_t seqnum = cmesh->
ConnectVec()[cindex].SequenceNumber();
1377 int blsize = cmesh->
Block().
Size(seqnum);
1380 for (int64_t i=position; i< position+blsize; i++) {
1381 sol[i-position] = glob(i,0);
1390 for (int64_t i=0; i<cvec.
size(); i++) {
1391 norm += cvec[i]*cvec[i];
1401 for (int64_t el=0; el<nel; el++) {
1408 for (ic=0; ic<nc; ic++) {
1415 #ifndef STATE_COMPLEX 1425 bool hasgeometry =
false;
1433 gel->
X(xicenter,xcenter);
1435 out <<
"CompEl " << el;
1437 out <<
" Gel " << gel->
Index() <<
" matid " << gel->
MaterialId() <<
" Center " << xcenter << std::endl;
1439 for (ic = 0; ic<nc; ic++) {
1444 out <<
"connect " << ic <<
" is restrained\n";
1448 for (
int i=0; i<connectsol.
size(); i++) {
1449 if (
fabs(connectsol[i]) <
tol) {
1453 out << ic <<
" index " << cindex <<
" values " << connectsol << std::endl;
1460 return Hash(
"TPZAnalysis");
int64_t NElements() const
Number of computational elements allocated.
pthread_mutex_t fGetUniqueId
Mutexes (to sum error)
TPZVec< TPZCompEl * > fCompElPtr
TPZMatrixSolver< STATE > * fSolver
Type of solver to be applied.
virtual TPZVec< STATE > IntegrateSolution(int var) const
Compute the integral of a variable.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
#define PZ_PTHREAD_MUTEX_UNLOCK(mutex, fn)
void LoadShape(double dx, double dy, int64_t numelem, TPZConnect *nod)
Make assembling and clean the load and solution vectors.
Represents a graphical mesh used for post processing purposes. Post processing.
void AnalyseGraph()
Group the node graph as passed by the parameters.
Material which implements a Lagrange Multiplier.
Contains the TPZMVGraphMesh class which implements graphical mesh to MVGraph package.
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
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
const int64_t numel
Number of elements to test.
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
void SetElementGraph(TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
This method declares the element graph to the object.
void ResetMatrix() override
Resets current object.
virtual void SetFileName(const std::string &filename)
Sets the name of the output file.
virtual void Residual(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &rhs, TPZFMatrix< TVar > &res)
Computes res = rhs - this * x.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
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.
void ShareMatrix(TPZMatrixSolver< TVar > &other)
Shares the current matrix with another object of same type.
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
Implements Block Diagonal Structural Matrices. Structural Matrix.
void Print(const std::string &name, std::ostream &out)
Print connect and solution information.
virtual void PrintCoordinate(TPZVec< REAL > &point, int CoordinateIndex, std::ostream &out)
Prints one coordinate index corresponding to the point to the output stream.
void OptimizeBandwidth()
Sets the computer connection block number from the graphical connections block number otimization...
Contains TPZSparseBlockDiagonal class which implements a block diagonal matrix where the blocks are n...
int MaterialId() const
Returns the material index of the element.
TPZFMatrix< STATE > fSolution
Solution vector.
clarg::argBool bc("-bc", "binary checkpoints", false)
virtual void PostProcessTable(std::ostream &out_file)
Print the solution related with the computational element vector in post process. ...
virtual void BuildConnectList(std::set< int64_t > &indepconnectlist, std::set< int64_t > &depconnectlist)
Builds the list of all connectivities related to the element including the connects pointed to by dep...
virtual void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> func, TPZVec< REAL > &errors, bool store_error)
Performs an error estimate on the elemen.
Implements renumbering for elements of a mesh. Utility.
void ConvertGraph(TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex, TPZManVector< int64_t > &nodegraph, TPZManVector< int64_t > &nodegraphindex)
Will convert an element graph defined by elgraph and elgraphindex into a node graph defined by nodegr...
virtual void UpdateFrom(TPZAutoPointer< TPZMatrix< TVar > > matrix) override
Updates the values of the current matrix based on the values of the matrix.
virtual void resize(const int64_t newsize)
virtual void PrintSolution(TPZVec< REAL > &point, const char *VarName, std::ostream &out)
Prints the solution - sol - for the variable "VarName" at point specified in terms of the master elem...
TPZManVector< int64_t > & Nodegraphindex()
Implements the interface of the graphmesh to the OpenDX graphics package. Post processing.
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
int64_t NIndependentConnects()
Number of independent connect objects.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Contains the TPZVTKGraphMesh class which implements the graphical mesh to VTK environment.
void SaddlePermute()
Put the sequence number of the pressure connects after the seq number of the flux connects...
int fNthreadsError
Number of threads to be used for post-processing error.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
virtual void Resequence(TPZVec< int64_t > &perm, TPZVec< int64_t > &iperm)
void WritePointers(const TPZVec< TPZAutoPointer< T >> &vec)
int ClassId() const override
Define the class id associated with the class.
virtual int Zero()
Zeroes the matrix.
Defines step solvers class. Solver.
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
TPZCompMesh * fCompMesh
Computational mesh.
virtual int VariableIndex(const std::string &name)
Returns the variable index associated with the name.
#define RENUMBER
To renumbering will use sloan library.
Implements a block diagonal matrix where the blocks are not contiguous. Matrix.
virtual void Assemble()
Assemble the stiffness matrix and load vector.
To export a graphical mesh to VTK environment. Post processing.
void PrintVectorByElement(std::ostream &out, TPZFMatrix< STATE > &vec, REAL tol=1.e-10)
Print the residual vector for those elements with entry above a given tolerance.
TPZCompMesh * Mesh() const
Returns the pointer to the computational mesh.
To export a graphical three dimensional mesh to use at V3D package. Post processing.
int64_t NElements() const
Number of elements of the mesh.
TPZVec< STATE > Integrate(const std::string &varname, const std::set< int > &matids)
Integrate the postprocessed variable name over the elements included in the set matids.
virtual void Solve(const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual=0)=0
Solves the system of linear equations.
virtual int Dimension() const =0
Returns the integrable dimension of the material.
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
static void * ThreadWork(void *threaddata)
Declarates the TPZBlock<REAL>class which implements block matrices.
static void ConnectSolution(int64_t cindex, TPZCompMesh *cmesh, TPZFMatrix< STATE > &glob, TPZVec< STATE > &sol)
extract the values corresponding to the connect from the vector
virtual void PrePostProcessTable(std::ostream &out_file)
Prepare data to print post processing and print coordinates.
virtual int MinimumNumberofLoadCases()
returns the minimum number of load cases for this material
void AppendSolver(TPZMatrixSolver< TVar > &solve)
virtual void PrintTitle(const char *VarName, std::ostream &out)
Prints the variables names associated with the element material.
virtual void DefineGraphMesh(int dimension, const TPZVec< std::string > &scalnames, const TPZVec< std::string > &vecnames, const std::string &plotfile)
Define GrapMesh as V3D, DX, MV or VTK depending on extension of the file.
int64_t NElements() const
Access method to query the number of elements of the vector.
Implements a chunk vector with free store administration. Utility.
#define LOGPZ_WARN(A, B)
Define log for warnings.
TPZVec< std::string > fVariableNames
static int ColorGraph(TPZVec< int64_t > &graph, TPZVec< int64_t > &graphindex, int64_t neq, TPZVec< int > &colors)
Color the graph into mutually independent blocks.
virtual int NSides() const =0
Returns the number of connectivities of the element.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
EPrecond
Preconditioners which can be created by objects of this class.
static TPZSavable * GetInstance(const int64_t &objId)
void ReadPointers(TPZVec< TPZAutoPointer< T >> &vec)
TPZMatrixSolver< STATE > * BuildPreconditioner(EPrecond preconditioner, bool overlap)
Define the type of preconditioner used.
Contains TPZBlockDiagonal class which defines block diagonal matrices.
std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> fExact
Pointer to Exact solution function, it is necessary to calculating errors.
TPZManVector< TPZManVector< REAL, 10 >, 100 > fvalues
TPZMatrixSolver< STATE > & Solver()
Get the solver matrix.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
void ComputeElGraph(TPZStack< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
Computes the connectivity graph of the elements, as appropriate for the TPZRenumbering class...
void BuildNodeGraph(TPZVec< int64_t > &blockgraph, TPZVec< int64_t > &blockgraphindex)
Build the graph which groups the equations of each node.
virtual ~TPZAnalysis(void)
Destructor: deletes all protected dynamic allocated objects.
int ClassId() const override
Define the class id associated with the class.
Refines geometrical mesh (all the elements) num times.
void CleanUp()
deletes all data structures
Contains the TPZBlockDiagonalStructMatrix class which implements Block Diagonal Structural Matrices...
This abstract class defines the behaviour which each derived class needs to implement.
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const =0
It returns the coordinates from the center of the side of the element in the element coordinate space...
void SetResolution(int res)
Sets resolution.
TPZAutoPointer< TPZGuiInterface > fGuiInterface
Pointer for gui interface object.
#define PZ_PTHREAD_JOIN(thread, val, fn)
TPZAdmChunkVector< TPZCompEl * > fElvec
static TPZAutoPointer< TPZSavable > GetAutoPointer(const int64_t &objId)
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
TPZAnalysis()
Create an empty TPZAnalysis object.
void ShowShape(const std::string &plotfile, TPZVec< int64_t > &equationindices)
Graphic of the solution as V3DGrap visualization.
virtual TPZStructMatrixOR * Clone() override
void SetJacobi(const int64_t numiterations, const REAL tol, const int64_t FromCurrent)
Contains the TPZV3DGraphMesh class which implements the graphical three dimensional mesh to use at V3...
int Zero() override
Makes Zero all the elements.
int64_t size() const
Returns the number of elements of the vector.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
Contains the TPZBoostGraph class which implements an interface to the BGL for graph operations...
TPZCompEl * Element(int64_t iel)
std::list< int64_t > & Singular()
returns the equations for which the equations had zero pivot
void LoadSolution(const TPZFMatrix< STATE > &sol)
Given the solution of the global system of equations, computes and stores the solution for the restri...
void Resize(const int newsize)
Increase the size of the chunk vector.
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
Implements the sequence of actions to perform a finite element analysis. Analysis.
void Push(const T object)
Pushes a copy of the object on the stack.
virtual void DrawSolution(TPZBlock< REAL > &Sol)
Draw solution as dx file.
#define PZ_PTHREAD_MUTEX_LOCK(mutex, fn)
virtual void LoadSolution()
Load the solution into the computable grid.
virtual void Write(const bool val)
TPZAutoPointer< TPZRenumbering > fRenumber
Renumbering scheme.
virtual void PostProcessErrorParallel(TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout)
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
ThreadData(TPZAdmChunkVector< TPZCompEl *> &elvec, bool store_error, std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> f)
int IsDecomposed() const
Checks if current matrix is already decomposed.
TPZGeoMesh * fGeoMesh
Geometric Mesh.
virtual void CloseGraphMesh()
Clean the GrapMesh vector.
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
Computes the cardinality of a nodegraph, identifying nodes as vertices, lines, faces or volumes...
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual void SetCompMesh(TPZCompMesh *mesh, const std::set< int > &matids)
Sets the computational mesh to associate.
TPZVec< std::string > fScalarNames[3]
Scalar variables names - to post process.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
Free store vector implementation.
int Dimension() const
Returns the dimension of the simulation.
virtual void SetMatrix(TPZAutoPointer< TPZMatrix< TVar > > Refmat)
Sets a matrix to the current object.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void SetElementsNodes(int64_t NElements, int64_t NNodes)
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
TPZCompEl * Reference() const
Return a pointer to the element referenced by the geometric element.
TPZVec< int64_t > fGeoElId
int64_t Rows() const
Returns number of rows.
static STATE ConnectNorm(int64_t cindex, TPZCompMesh *cmesh, TPZFMatrix< STATE > &glob)
TPZMatrixSolver< STATE > * BuildSequenceSolver(TPZVec< int64_t > &graph, TPZVec< int64_t > &graphindex, int64_t neq, int numcolors, TPZVec< int > &colors)
Build a sequence solver based on the block graph and its colors.
virtual void DrawMesh(int numcases)
Draw the graphical mesh.
int HasDependency() const
Returns whether exist dependecy information.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Contains TPZSequenceSolver class which defines sequence solvers.
TPZGeoEl * FindElement(TPZVec< REAL > &x, TPZVec< REAL > &qsi, int64_t &InitialElIndex, int targetDim) const
Returns the element that contains the given point x and it respective point in parametric domain qsi...
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
TPZVec< std::string > fVectorNames[3]
Vectorial variables names - to post process.
Contains the TPZGraphMesh class which represents a graphical mesh used for post processing purposes...
void SetNumLoadCases(int numloadcases)
changes the number of load cases for this material
#define PZ_PTHREAD_MUTEX_DESTROY(mutex, fn)
void IdentifyPostProcessingMatIds(int dimension, std::set< int > &matids)
Fill mat ids with materials with provided dimension wich are not boundary conditinos or interface...
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
pthread_mutex_t fAccessElement
Mutexes (to choose which element is next)
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Contains declaration of TPZCompMesh class which is a repository for computational elements...
virtual void PostProcess(int resolution)
Draw solution over mesh for all dimensions.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
void Print(TPZVec< int64_t > &grapho, TPZVec< int64_t > &graphoindex, const char *name=0, std::ostream &out=std::cout)
Prints graph.
virtual void DrawMesh(int numcases)
Draw mesh as dx file.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
void BuildVertexGraph(TPZStack< int64_t > &blockgraph, TPZVec< int64_t > &blockgraphindex)
build the graph which builds the equations linked to vertices
virtual void Run(std::ostream &out=std::cout)
Calls the appropriate sequence of methods to build a solution or a time stepping sequence.
int32_t Hash(std::string str)
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
virtual int64_t ConnectIndex(int i) const =0
Returns the index of the ith connectivity of the element.
virtual void SetFileName(const std::string &filename)
Sets the filename to output of graph.
virtual TPZSolver * Clone() const =0
Clones the current object returning a pointer of type TPZSolver.
virtual int NConnects() const =0
Returns the number of nodes of the element.
virtual void DefineElementTable(int dimension, TPZVec< int64_t > &GeoElIds, TPZVec< REAL > &points)
Fill the computational element vector to post processing depending over geometric mesh defined...
void SetStep(int step)
ste the step for post processing
void Read(TPZStream &buf, void *context) override
read objects from the stream
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
virtual int Dimension() const =0
Returns the dimension of the element.
void BuildElementGraph(TPZStack< int64_t > &blockgraph, TPZStack< int64_t > &blockgraphindex)
Build the graph which groups the equations grouped by elements.
TPZGraphMesh * fGraphMesh[3]
Graphical mesh.
TPZAutoPointer< TPZStructMatrix > fStructMatrix
Structural matrix.
virtual void AssembleResidual()
Assemble the load vector.
void Read(TPZStream &buf, void *context) override
read objects from the stream
virtual void DrawSolution(int step, REAL time)
Draw solution depending on the resolution.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
virtual int NSolutionVariables(int var)
Returns the number of variables associated with the variable indexed by var.
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
Free store vector implementation in chunks.
This class implements a geometric mesh for the pz environment. Geometry.
static void ExpandGraph(TPZVec< int64_t > &graph, TPZVec< int64_t > &graphindex, TPZBlock< STATE > &block, TPZVec< int64_t > &expgraph, TPZVec< int64_t > &expgraphindex)
Expand the graph acording to the block structure.
Defines sequence solvers. Solver.
Implements computational mesh. Computational Mesh.
int Size(const int block_diagonal) const
Returns block dimension.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
TPZAutoPointer< TPZMatrix< TVar > > Matrix() const
Returns a pointer to TPZMatrix<>
#define PZ_PTHREAD_CREATE(thread, attr, routine, args, fn)
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
Contains TPZStepSolver class which defines step solvers class.
virtual void Print(std::ostream &out) const
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Defines the interface for saving and reading data. Persistency.
std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> fExact
int64_t NElements() const
Returns the number of elements of the vector.
Contains the TPZSloan class.
TPZFMatrix< STATE > & Rhs()
Returns the load vector.
virtual void PostProcessErrorSerial(TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout)
void SetDirect(const DecomposeType decomp)
Contains the TPZDXGraphMesh class which implements the interface of the graphmesh to the OpenDX graph...
clarg::argInt porder("-porder", "polinomial order", 1)
void CreateListOfCompElsToComputeError(TPZAdmChunkVector< TPZCompEl *> &elvec)
virtual void Resequence(TPZVec< int64_t > &perm, TPZVec< int64_t > &iperm)
#define PZ_PTHREAD_MUTEX_INIT(mutex, attr, fn)
TPZFMatrix< STATE > fRhs
Load vector.
TPZVec< std::string > fTensorNames[3]
Tensorial variables names - to post process.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
int HighestDimension()
Returns the dimension of the material which has the highest dimension.
void Print(const TPZCompMesh &mesh, std::ostream &out=std::cout)
Print the information for the connect element.
void AssembleBlockDiagonal(TPZBlockDiagonal< STATE > &block)
void AnimateRun(int64_t num_iter, int steps, TPZVec< std::string > &scalnames, TPZVec< std::string > &vecnames, const std::string &plotfile)
Run and print the solution step by step.
Contains the TPZNodesetCompute class which computes the cardinality of a nodegraph.
void ConnectSolution(std::ostream &out)
Print the solution by connect index.
Defines the interface of a computational element. Computational Element.
Implements graphical mesh to MVGraph package. Post processing.
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
virtual void PostProcessError(TPZVec< REAL > &, bool store_error=true, std::ostream &out=std::cout)
Compute the local error over all elements and global errors in several norms and print out without ca...
Interface to sloan subrotines. Utility.
TPZVec< REAL > fLocations
virtual void SetCompMesh(TPZCompMesh *mesh, bool mustOptimizeBandwidth)
Set the computational mesh of the analysis.
void TransferMultiphysicsSolution()
Transfer multiphysics mesh solution.
TPZFMatrix< STATE > & Solution()
Access the solution vector.
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
REAL fTime
Time variable which is used in dx output.
Contains TPZMetis class which implements the renumbering for elements of a mesh to minimize the band...
virtual void SetTableVariableNames(TPZVec< std::string > varnames)
Sets the names of the variables into the data structure for post processing.
TPZManVector< int64_t > & Nodegraph()
#define PZError
Defines the output device to error messages and the DebugStop() function.
virtual void Read(bool &val)
int ComputeNumberofLoadCases()
Determine the number of load cases from the material objects and return its value.
void Permute(TPZVec< int64_t > &permute)
Permute the sequence number of the connect objects It is a permute gather operation.
This class implements a reference counter mechanism to administer a dynamically allocated object...
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.