29 static LoggerPtr logger(Logger::getLogger(
"pz.StrMatrix"));
41 if(logger->isDebugEnabled())
43 LOGPZ_DEBUG(logger,
"TPZSpStructMatrix::CreateAssemble starting")
47 int64_t neq = fMesh->NEquations();
48 if(fMesh->FatherMesh()) {
49 cout <<
"TPZSpStructMatrix should not be called with CreateAssemble for a substructure mesh\n";
56 TPZTimer before(
"Assembly of a sparse matrix");
59 if (logger->isDebugEnabled())
61 LOGPZ_DEBUG(logger,
"TPZSpStructMatrix::CreateAssemble calling Assemble()");
64 Assemble(*stiff,rhs,guiInterface);
66 std::cout << __PRETTY_FUNCTION__ <<
" " << before << std::endl;
71 if(logger->isDebugEnabled())
LOGPZ_DEBUG(logger,
"TPZSpStructMatrix::CreateAssemble exiting");
76 int64_t neq = fEquationFilter.NActiveEquations();
89 fMesh->ComputeElGraph(elgraph,elgraphindex);
101 metis.
ConvertGraph(elgraph,elgraphindex,nodegraph,nodegraphindex);
104 if(logger->isDebugEnabled()){
105 std::stringstream sout;
106 sout <<
"Node graph \n";
107 metis.TPZRenumbering::Print(nodegraph, nodegraphindex);
112 int64_t nblock = nodegraphindex.
NElements()-1;
114 int64_t totalvar = 0;
117 for(int64_t i=0;i<nblock;i++){
118 int64_t iblsize = fMesh->Block().Size(i);
119 int64_t iblpos = fMesh->Block().Position(i);
120 int64_t numactive = fEquationFilter.NumActive(iblpos, iblpos+iblsize);
125 int64_t icfirst = nodegraphindex[i];
126 int64_t iclast = nodegraphindex[i+1];
129 totalvar+=iblsize*iblsize;
130 for(j=icfirst;j<iclast;j++) {
131 int64_t col = nodegraph[j];
132 int64_t colsize = fMesh->Block().Size(col);
133 int64_t colpos = fMesh->Block().Position(col);
134 int64_t numactive = fEquationFilter.NumActive(colpos, colpos+colsize);
138 totalvar += iblsize*colsize;
143 if (logger->isDebugEnabled()) {
144 std::stringstream sout;
145 sout <<
"Number of equations " << totaleq <<
" number of nonzero s " << totalvar;
153 nblock=fMesh->NIndependentConnects();
158 for(int64_t i=0;i<nblock;i++){
159 int64_t iblsize = fMesh->Block().Size(i);
160 int64_t iblpos = fMesh->Block().Position(i);
162 for (int64_t ij=0; ij<iblsize; ij++) {
163 rowdestindices[ij] = iblpos+ij;
165 fEquationFilter.Filter(rowdestindices);
170 for(ibleq=0; ibleq<rowdestindices.
size(); ibleq++) {
171 int rowind = rowdestindices[ibleq];
176 int64_t colsize,colpos,jbleq;
177 int64_t diagonalinsert = 0;
178 int64_t icfirst = nodegraphindex[i];
179 int64_t iclast = nodegraphindex[i+1];
181 for(j=icfirst;j<iclast;j++)
184 int64_t col = nodegraph[j];
188 if(!diagonalinsert && col > i)
191 int64_t colsize = fMesh->Block().Size(i);
192 int64_t colpos = fMesh->Block().Position(i);
194 for (int64_t i=0; i<colsize; i++) {
195 destindices[i] = colpos+i;
197 fEquationFilter.Filter(destindices);
199 for(jbleq=0; jbleq<destindices.
size(); jbleq++) {
201 EqCol[pos] = destindices[jbleq];
208 colsize = fMesh->Block().Size(col);
209 colpos = fMesh->Block().Position(col);
211 if (fEquationFilter.NumActive(colpos, colpos+colsize) == 0) {
215 for (int64_t i=0; i<colsize; i++) {
216 destindices[i] = colpos+i;
218 fEquationFilter.Filter(destindices);
219 for(jbleq=0; jbleq<destindices.
size(); jbleq++) {
220 EqCol[pos] = destindices[jbleq];
230 int64_t colsize = fMesh->Block().Size(i);
231 int64_t colpos = fMesh->Block().Position(i);
233 for (int64_t i=0; i<colsize; i++) {
234 destindices[i] = colpos+i;
236 fEquationFilter.Filter(destindices);
238 for(jbleq=0; jbleq<destindices.
size(); jbleq++) {
240 EqCol[pos] = destindices[jbleq];
254 mat->
SetData(Eq,EqCol,EqValue);
268 #ifndef STATE_COMPLEX 278 double coordstore[4][3] = {{0.,0.,0.},{1.,0.,0.},{1.,1.,0.},
285 for (j=0; j<3; j++) coord[j] = coordstore[i][j];
295 for(el=0; el<1; el++) {
299 for(i=0; i<4; i++) indices[i] = i;
309 cout <<
"Refinement ";
326 cout <<
"Interpolation order ";
337 ofstream output(
"outputPar.dat");
int ClassId() const override
Define the class id associated with the class.
The timer class. Utility.
int AllocateNewElement()
Makes more room for new elements.
Contains TPZAnalysis class which implements the sequence of actions to perform a finite element analy...
void SetElementGraph(TPZVec< int64_t > &elgraph, TPZVec< int64_t > &elgraphindex)
This method declares the element graph to the object.
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.
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
Timing class. Absolutely copied from GNU time. Take a look at
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...
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
Defines step solvers class. Solver.
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
Implements a non symmetric sparse matrix (Yale Sparse Matrix Storage). Matrix.
Contains declaration of TPZGeoElBC class, it is a structure to help the construction of geometric ele...
virtual void SetData(int64_t *IA, int64_t *JA, TVar *A)
Pass the data to the class.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
virtual TPZMatrix< STATE > * Create() override
void SetDefaultOrder(int order)
int ClassId() const override
Define the class id associated with the class.
Refines geometrical mesh (all the elements) num times.
This abstract class defines the behaviour which each derived class needs to implement.
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
void SetJacobi(const int64_t numiterations, const REAL tol, const int64_t FromCurrent)
int64_t size() const
Returns the number of elements of the vector.
Contains the TPZSpStructMatrix class which implements sparse structural matrices. ...
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
Implements the sequence of actions to perform a finite element analysis. Analysis.
void start()
Turns the timer on.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual TPZStructMatrix * Clone() override
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
void SetElementsNodes(int64_t NElements, int64_t NNodes)
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override
Contains the TPZFYsmpMatrix class which implements a non symmetric sparse matrix. ...
Contains the TPZMat2dLin class which implements a bi-dimensional linear problem.
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.
void SetMaterial(TPZFMatrix< STATE > &xkin, TPZFMatrix< STATE > &xcin, TPZFMatrix< STATE > &xfin)
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)
Structure to help the construction of geometric elements along side of a given geometric element...
void BuildConnectivity()
Build the connectivity of the grid.
virtual TPZBndCond * CreateBC(TPZMaterial *reference, int id, int typ, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
Creates an object TPZBndCond derived of TPZMaterial.
int InsertMaterialObject(TPZMaterial *mat)
Insert a material object in the datastructure.
This class implements a geometric mesh for the pz environment. Geometry.
Implements a bi-dimensional linear problem.
Implements computational mesh. Computational Mesh.
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
Contains TPZStepSolver class which defines step solvers class.
Implements Sparse Structural Matrices. Structural Matrix.
void stop()
Turns the timer off, and computes the elapsed time.
int64_t NElements() const
Returns the number of elements of the vector.
Contains the TPZDXGraphMesh class which implements the interface of the graphmesh to the OpenDX graph...
void InitializeBlock()
Resequence the block object, remove unconnected connect objects and reset the dimension of the soluti...
Contains TPZMetis class which implements the renumbering for elements of a mesh to minimize the band...