35 static LoggerPtr logger(Logger::getLogger(
"pz.strmatrix.frontstructmatrix"));
36 static LoggerPtr loggerel(Logger::getLogger(
"pz.strmatrix.element"));
41 template <
class front>
45 fMesh->ComputeNodElCon();
47 for(ic=0; ic<fMesh->ConnectVec().NElements(); ic++) {
51 if(seqn < 0)
continue;
52 int64_t firsteq = fMesh->Block().Position(seqn);
53 int64_t lasteq = firsteq+fMesh->Block().Size(seqn);
54 int64_t numactive = fEquationFilter.NumActive(firsteq, lasteq);
55 if(!numactive)
continue;
56 if (numactive != lasteq-firsteq) {
60 for (int64_t i = 0; i<numactive; i++) {
62 destindex[i] = firsteq+i;
64 fEquationFilter.Filter(firstind, destindex);
65 for(int64_t ind=0;ind<destindex.
size();ind++)
66 numelconnected[destindex[ind] ] = fMesh->ConnectVec()[ic].NElConnected();
103 template<
class front>
106 int64_t numelconnected = 0;
111 firstelconnect[0] = 0;
112 for(ic=0; ic<nconnect; ic++) {
114 firstelconnect[ic+1] = firstelconnect[ic]+
fMesh->
ConnectVec()[ic].NElConnected();
118 if (logger->isDebugEnabled())
120 std::stringstream sout;
121 sout<<
"numelconnected " << numelconnected << endl;
122 sout<<
"firstelconnect "<< firstelconnect;
139 for(ic=0; ic<nc; ic++) {
140 int64_t cindex = connectlist[ic];
141 elconnect[firstelconnect[cindex]] = el;
142 firstelconnect[cindex]++;
147 if (logger->isDebugEnabled())
149 std::stringstream sout;
150 sout<<
"elconnect "<< elconnect;
154 firstelconnect[0] = 0;
155 for(ic=0; ic<nconnect; ic++) {
156 firstelconnect[ic+1] = firstelconnect[ic]+
fMesh->
ConnectVec()[ic].NElConnected();
162 if (logger->isDebugEnabled())
164 std::stringstream sout;
165 sout<<
"Node index " << no <<
' ' <<
" seq num " <<
fMesh->
ConnectVec()[no].SequenceNumber() <<
' ';
178 firstelconnect[0] = 0;
179 for(ic=0; ic<nconnect; ic++) {
181 if(seqnum >= 0) nodeorder[seqnum] = ic;
188 int64_t elsequence = 0;
190 for(seq=0; seq<nconnect; seq++) {
192 if(ic == -1)
continue;
193 int64_t firstind = firstelconnect[ic];
194 int64_t lastind = firstelconnect[ic+1];
196 for(ind=firstind; ind<lastind; ind++) {
201 if(elorderinv[el]==-1) elorderinv[el] = elsequence++;
209 if(elorderinv[seq] == -1)
continue;
213 if (logger->isDebugEnabled())
215 std::stringstream sout;
217 sout<<
"elorderinv " << elorderinv << std::endl;
226 template<class front>
253 if (logger->isDebugEnabled())
255 std::stringstream sout;
268 template<
class front>
286 for(iel=0; iel < nelem; iel++) {
288 if(guiInterface)
if(guiInterface->
AmIKilled()){
299 ek.ComputeDestinationIndices();
305 if(!(numel%20)) cout << endl <<
numel;
313 stiffness.
AddKel(ek.fMat,ek.fSourceIndex,ek.fDestinationIndex);
314 rhs.
AddFel(ef.
fMat,ek.fSourceIndex, ek.fDestinationIndex);
318 ek.ApplyConstraints();
320 stiffness.
AddKel(ek.fConstrMat,ek.fSourceIndex,ek.fDestinationIndex);
339 template<
class front>
354 for(iel=0; iel < nelem; iel++) {
357 if(elindex < 0)
continue;
363 int matid = mat->
Id();
379 std::cout<<
" assemblando elemento frontal " << iel <<std::endl;
382 if (logger->isDebugEnabled())
384 std::stringstream sout;
385 ek.fMat.Print(
"Element stiffness Frontal",sout);
392 if(loggerel->isDebugEnabled())
394 std::stringstream sout;
395 ek.fMat.Print(
"Element stiffness depois de assemblada ",sout);
404 cout <<
" " << (100*iel/nelem) <<
"% Elements assembled " << endl;
415 template<
class front>
426 if (logger->isDebugEnabled())
428 std::stringstream sout;
444 if (logger->isDebugEnabled())
446 std::stringstream sout;
461 template<
class front>
467 #ifndef STATE_COMPLEX 470 template<
class front>
477 double coordstore[4][3] = {{0.,0.,0.},{1.,0.,0.},{1.,1.,0.},
484 for (j=0; j<3; j++) coord[j] = coordstore[i][j];
490 gmesh.
NodeVec ()[i].Initialize (i,coord,gmesh);
494 for(el=0; el<1; el++) {
498 for(i=0; i<4; i++) indices[i] = i;
510 cout <<
"Refinement ";
530 cout <<
"Interpolation order ";
541 ofstream output(
"outputNon.dat");
549 cout <<
"Numero de Equacoes -> " << cmesh.
NEquations() << endl;
552 ofstream out(
"cmeshBlock_out.txt");
559 if(seqn < 0)
continue;
561 int64_t lasteq = firsteq+cmesh.
Block().
Size(seqn);
563 int temp = cmesh.
ConnectVec()[ic].NElConnected();
564 for(ind=firsteq;ind<lasteq;ind++) {
565 numelconnected[ind] = temp;
603 an.
Print(
"solution of frontal solver", output);
644 template<
class front>
651 for(i=0; i<nconnect; i++)
658 int64_t connectcount = 0;
659 for(i=0; i<nelem; i++)
665 std::set<int64_t> indepconnects, depconnects;
667 std::set<int64_t>::iterator it;
668 for(it=indepconnects.begin(); it != indepconnects.end(); it++)
673 if(nelcon == 0) permute[seqnum]= connectcount++;
677 for(i=0; i<nconnect; i++)
683 std::cout << __PRETTY_FUNCTION__ <<
" very fishy\n";
688 if (logger->isDebugEnabled())
690 std::stringstream sout;
691 sout << __PRETTY_FUNCTION__ <<
" permutation " << permute;
void GetNumElConnected(TPZVec< int > &numelconnected)
Returns a vector containing all elements connected to a degree of freedom.
int64_t NElements() const
Number of computational elements allocated.
void OrderElement()
It is applied over fElementOrder putting it in the correct order.
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.
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.
void SetStructuralMatrix(TPZAutoPointer< TPZStructMatrix > strmatrix)
Set structural matrix as auto pointer for analysis.
void Print(const std::string &name, std::ostream &out)
Print connect and solution information.
Responsible for the frontal method as a whole. Frontal.
void Assemble(TPZMatrix< STATE > &stiffness, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
Assemble a stiffness matrix.
void DecrementElConnected()
Decrement fNElConnected.
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...
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...
Contains the TPZFrontStructMatrix class which responsible for a interface among Finite Element Packag...
TPZFront< TVar > & GetFront() override
returns a pointer to the front matrix
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
void AddFel(TPZFMatrix< TVar > &rhs, TPZVec< int64_t > &destination)
Performs a right hand side assemblage.
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
Defines step solvers class. Solver.
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef)
Computes the element stifness matrix and right hand side.
TPZEquationFilter fEquationFilter
Object which will determine which equations will be assembled.
Abstract class implements storage and decomposition process of the frontal matrix involving simmetry ...
Declarates the TPZBlock<REAL>class which implements block matrices.
int NumberRigidBodyModes()
Return the number of rigid body modes associated with the internal degrees of freedom.
int64_t NElements() const
Access method to query the number of elements of the vector.
Implements a chunk vector with free store administration. Utility.
Contains the TPZStructMatrixOR class which responsible for a interface among Matrix and Finite Elemen...
TPZManVector< int64_t > fDestinationIndex
void ComputeDestinationIndices()
virtual ~TPZFrontStructMatrix()
Class destructor.
Contains the TPZFStructMatrix class which implements Full Structural Matrices.
void SetDefaultOrder(int order)
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...
TPZCompMesh * fMesh
Pointer to the computational mesh from which the matrix will be generated.
DecomposeType fDecomposeType
Used Decomposition method.
void AdjustSequenceNumbering()
Resequence the connects according to the element order.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
TPZVec< int > fElementOrder
This vector contains an ordered list.
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 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.
void AssembleElement(TPZCompEl *el, TPZElementMatrix &ek, TPZElementMatrix &ef, TPZMatrix< STATE > &stiffness, TPZFMatrix< STATE > &rhs)
Computes element matrices.
Implements the sequence of actions to perform a finite element analysis. Analysis.
int64_t NActiveEquations() const
Retorna o numero de equacoes ativas do sistema.
Implements a group of computational elements as a mesh and an element. Computational Mesh...
#define DebugStop()
Returns a message to user put a breakpoint in.
void FinishWriting()
Finishes writing of a binary file and closes it.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
void SetNumElConnected(TPZVec< int > &numelconnected)
Initializes the number of elements connected to each equation.
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
void AssembleNew(TPZMatrix< STATE > &stiffness, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
Assemble a stiffness matrix according to rhs.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
int HasDependency() const
Returns whether exist dependecy information.
virtual void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
Responsible for a interface among Finite Element Package and Matrices package to frontal method...
void SetNumRigidBodyModes(int nrigid)
Indicate the first equation dedicated to rigid body modes.
Contains the TPZMat2dLin class which implements a bi-dimensional linear problem.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
int64_t Index() const
Returns element index of the mesh fELementVec list.
void ReOpen()
Reopen the binary file.
virtual bool ShouldCompute(int matid) const
Establish whether the element should be computed.
TPZManVector< int64_t > fSourceIndex
Contains declaration of TPZCompMesh class which is a repository for computational elements...
TPZStructMatrix * Clone()
Clones a TPZFrontStructMatrix.
void SetMaterial(TPZFMatrix< STATE > &xkin, TPZFMatrix< STATE > &xcin, TPZFMatrix< STATE > &xfin)
TPZMatrix< STATE > * Create()
Returns a pointer to TPZMatrix<STATE>
virtual void Run(std::ostream &out=std::cout)
Calls the appropriate sequence of methods to build a solution or a time stepping sequence.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
TPZFNMatrix< 1000, STATE > fConstrMat
Pointer to the constrained matrix object.
virtual void SetDecomposeType(DecomposeType dectype)=0
Set the decomposition type.
void ApplyConstraints()
Apply the constraints applied to the nodes by transforming the tangent matrix and right hand side...
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.
Contains declaration of TPZSubCompMesh class which implements a group of computational elements as a ...
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.
Contains TPZSubMeshFrontalAnalysis class which implements the analysis for substructuring.
Implements computational mesh. Computational Mesh.
int Size(const int block_diagonal) const
Returns block dimension.
Contains the TPZAbstractFrontMatrix class which implements a matrix stored in a frontal decomposition...
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...
int NElConnected() const
Returns fNElConnected.
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 FilterEquations(TPZVec< int64_t > &origindex, TPZVec< int64_t > &destindex) const
Filter out the equations which are out of the range.
int64_t NElements() const
Returns the number of elements of the vector.
void SetDirect(const DecomposeType decomp)
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...
Defines the interface of a computational element. Computational Element.
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
virtual int HasDependency()
Returns 1 if the element has at least one dependent node. Returns 0 otherwise.
Abstract class implements storage and decomposition process of the frontal matrix involving non-simet...
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
void Permute(TPZVec< int64_t > &permute)
Permute the sequence number of the connect objects It is a permute gather operation.