42 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.subcmesh"));
43 static LoggerPtr logger2(Logger::getLogger(
"pz.mesh.tpzcompmesh"));
58 disp[0] = -(x[1]-0.5)*
sin(angle)+(x[0]-0.5)*
cos(angle)-(x[0]-0.5);
59 disp[1] = (x[1]-0.5)*
cos(angle)+(x[0]-0.5)*
sin(angle)-(x[1]-0.5);
70 std::ofstream output(
"output.dat");\
73 double coordstore[4][2] = {{0.,0.},{1.,0.},{1.,1.},{0.,1.}};
79 for(i=0; i<4*(numel+1); i++) {
81 coord[j] = coordstore[i%4][j];
85 geo.
NodeVec()[i].Initialize(i,coord,geo);
93 for(i=0; i<
numel; i++) {
95 for(j=0; j<8; j++) indices[j] = 4*i+j;
119 bnd = meumat->
CreateBC (meumat,-2,0,val1,val2);
134 for (i=0;i<
numel;i++){
140 for (i=0;i<
numel;i++){
144 for (i=0;i<
numel;i++){
170 sub[0]->
Print(output);
208 for(i=0; i<nelem; i++){
218 for(i=0; i<nelem; i++){
227 for(i=0; i<nelem; i++){
236 for(i=0; i<nelem; i++){
245 for(i=0; i<nelem; i++) {
268 int64_t pos1=0, pos2, comind;
274 father = s1[pos1]->FatherMesh();
282 father = s2[pos2]->FatherMesh();
284 if (s1[pos1] != s2[pos2])
return 0;
286 for (; pos1>=0 && pos2>=0; pos1--, pos2--) {
287 if((s1[pos1])!=(s2[pos2])) {
292 return (pos1 >=0 ) ? (s1[pos1+1]) : s2[pos2+1];
301 std::map<int64_t,int64_t>::iterator it;
327 std::map<int64_t,int64_t>::const_iterator it;
329 nelconnected[it->second]++;
360 if(super ==
this)
return nolocal;
389 int64_t seqnum =
fConnectVec[connectindex].SequenceNumber();
390 int blocksize = nshape*nstate;
392 fConnectVec[connectindex].SetOrder(order,connectindex);
395 if(oldsize <= connectindex) {
407 int64_t seqnum =
fConnectVec[connectindex].SequenceNumber();
408 int nshape = connect.
NShape();
409 int nstate = connect.
NState();
410 int blocksize = nshape*nstate;
414 if(oldsize <= connectindex) {
450 std::cout <<
"TPZSubCompMesh iconsistent data structure !";
456 if(super ==
this)
return local;
462 if(super ==
this)
return superind;
468 std::map<int64_t,int64_t>::iterator it =
fFatherToLocal.find(superind);
486 if(logger->isDebugEnabled())
488 std::stringstream sout;
489 sout <<
"Connect in fathermesh " << superind <<
" existing connect found : corresponds to connect " << j <<
" in subcompmesh";
500 out <<
"Sub Mesh" << (
void *)
this;
507 if (fExternalLocIndex[i] != -1) out <<
" Index in father mesh:\t" <<
fConnectIndex[fExternalLocIndex[i]];
510 std::map<int64_t,int64_t>::const_iterator it;
511 out <<
"Global to Local map ";
513 out << it->first <<
'|' << it->second <<
' ';
529 if(father->
ConnectVec()[superind].NElConnected() != 1)
531 std::cout << __PRETTY_FUNCTION__ <<
" number of elements connected to connect " << superind <<
532 " = " << father->
ConnectVec()[superind].NElConnected() << std::endl;
534 if(father &&
RootMesh(local) != father) {
535 std::cout <<
"ERROR";
545 father->
ConnectVec()[superind].RemoveDepend(superind,depfatherindex);
546 listdepend = father->
ConnectVec()[superind].FirstDepend();
586 depend = depend->
fNext;
611 if (logger->isDebugEnabled())
613 std::stringstream sout;
634 std::set<int64_t> cantransfer;
635 std::set<int64_t> delaytransfer;
636 std::map<int64_t,int64_t>::iterator it;
639 if (father->
ConnectVec()[it->first].NElConnected() == 1)
641 cantransfer.insert(it->second);
645 while (cantransfer.size() || delaytransfer.size())
647 std::set<int64_t>::iterator itset;
648 for (itset = cantransfer.begin(); itset != cantransfer.end(); itset++) {
650 int64_t csubmeshindex = *itset;
660 std::set<int64_t> dependset;
662 for (std::set<int64_t>::iterator it = dependset.begin(); it != dependset.end(); it++) {
663 int64_t connectindex = *it;
666 if (cantransfer.find(submeshconnectindex) != cantransfer.end())
668 delaytransfer.insert(submeshconnectindex);
669 cantransfer.erase(submeshconnectindex);
675 if (logger->isDebugEnabled())
677 std::stringstream sout;
678 sout <<
" connect indexes that will be transferred ";
679 std::copy(cantransfer.begin(), cantransfer.end(), std::ostream_iterator<int64_t>(sout,
" "));
681 sout <<
" connect indexes that are delayed ";
682 std::copy(delaytransfer.begin(), delaytransfer.end(), std::ostream_iterator<int64_t>(sout,
" "));
686 for (itset=cantransfer.begin(); itset!=cantransfer.end(); itset++)
689 if (logger->isDebugEnabled())
691 std::stringstream sout;
694 father->
ConnectVec()[fatherindex].Print(*father,sout);
695 sout <<
"Making the connect index " << *itset <<
" internal " <<
" index in the father mesh " << fatherindex << std::endl;
702 cantransfer = delaytransfer;
703 delaytransfer.clear();
799 connectindices.push_back(i);
804 if(father->
ConnectVec()[extcon].NElConnected() == 1)
806 connectindices.push_back(i);
818 if(mesh ==
this)
return elindex;
821 std::cout <<
"TPZSubCompMesh::TransferElementFrom ERROR: trying to transfer an element not allowed" << std::endl;
832 std::cout <<
"TPZSubCompMesh::TransferElementFrom ERROR: mesh is not supermesh" << std::endl;
840 std::cout <<
"TPZSubCompMesh::TransferElementFrom ERROR: element not existing" << std::endl;
860 for (
int i=0; i<ncon; i++){
905 int matid = matfather->
Id();
917 int refid = ref->
Id();
949 std::cout <<
"TPZSubCompMesh::TransferElementTo ERROR: mesh is not supermesh" << std::endl;
953 if(mesh ==
this)
return elindex;
962 std::cout <<
"TPZSubCompMesh::TransferElementTo ERROR: not possible transfer non existing element" << std::endl;
967 std::cout <<
"TPZSubCompMesh::TransferElementTo ERROR: not possible transfer null element" << std::endl;
971 for (i=0; i<ncon; i++){
1001 int64_t index = sub->
Index();
1002 return (elindex != index);
1015 std::cout <<
"The SubCompMesh needs a configured analysis\n";
1037 if (!ReducableStiff) {
1059 for (
int i = 0; i < nelemnodes ; i++) {
1066 for(
int i=0; i<nelemnodes; ++i){
1079 std::cout <<
"The SubCompMesh needs a configured analysis\n";
1100 int64_t numeq=0, numeq2=0;
1120 std::cout <<
"Number of connects of the submesh out of sink\n";
1124 std::map<int64_t,int64_t>::iterator it;
1132 LOGPZ_ERROR(logger,
"fExternalLocIndex and fFatherToLocal are out of sink")
1140 int64_t nconstrconnects = 0;
1153 if (numeq != numeq2 || numeq > numeq3) {
1161 int64_t numintconnects = nconnects-numextconnects-nconstrconnects;
1164 if (globeq2 != globeq) {
1167 int64_t numinteq = globeq - numeq;
1170 for (in=0; in<nconnects-1; in++) {
1174 if (pos2-pos1 != blsize) {
1179 int64_t numinteq2 = 0;
1181 if (numinteq != numinteq2) {
1186 for(in=0; in<nconnects; in++)
1195 std::stringstream sout;
1196 sout <<
"Connect " << in <<
" has equation " << eq <<
" but is external";
1201 std::stringstream sout;
1202 sout <<
"Connect " << in <<
" has equation " << eq <<
" but is internal and has no dependencies ";
1203 df.
Print(*
this,sout);
1209 std::stringstream sout;
1210 sout <<
"Connect " << in <<
" with dependency was not put at the end of the stack equation " << eq <<
" global equations " << globeq;
1234 for (i = 0; i < nelemnodes ; i++) {
1243 for(i=0; i<nelemnodes; ++i){
1250 ek.
fMat = *(stiff.operator->());
1280 if(castedAnalFrontal){
1284 if(!castedAnal && !castedAnalFrontal){
1290 if(logger->isDebugEnabled())
1292 std::stringstream sout;
1293 sout <<
"Substructure stiffness matrix\n";
1295 sout <<
"Substructure right hand side\n";
1350 if (logger->isDebugEnabled())
1352 std::stringstream sout;
1373 gmrs->
SetGMRES(20, 20, *step, 1.e-20, 0);
1389 int resolution = 100;
1392 std::string out(
"matrix_boost.vtk");
1394 std::string out(
"matrix_native.vtk");
1418 if (logger->isDebugEnabled())
1420 std::stringstream sout;
1441 gmrs->
SetGMRES(20, 20, *step, 1.e-20, 0);
1457 int resolution = 100;
1460 std::string out(
"matrix_boost.vtk");
1462 std::string out(
"matrix_native.vtk");
1478 int resolution = 100;
1481 std::string out(
"matrix_boost.vtk");
1483 std::string out(
"matrix_native.vtk");
1493 ->SetNumThreads(numThreads+2);
1518 std::map<int64_t,int64_t> independent;
1519 std::list<int64_t>
internal;
1523 std::stringstream sout;
1524 sout <<
"Index = " <<
Index() <<
" Internal connects ic/seqnum";
1525 std::list<int64_t>::iterator it;
1526 for(it=
internal.begin(); it!=
internal.end(); it++)
1528 sout << *it <<
"/" <<
ConnectVec()[*it].SequenceNumber() <<
" ";
1530 if (logger->isDebugEnabled())
1537 std::list<int64_t>::iterator it;
1538 for(it=
internal.begin(); it!=
internal.end(); it++)
1540 int64_t locind = *it;
1542 if(externallocindex > 0)
1545 if(father->ConnectVec()[superind].FirstDepend())
1550 independent[
ConnectVec()[locind].SequenceNumber()] = locind;
1553 else if (!
ConnectVec()[locind].FirstDepend())
1555 independent[
ConnectVec()[locind].SequenceNumber()] = locind;
1560 std::stringstream sout;
1561 sout <<
"Mesh Address " << (
void *)
this <<
" Index = " <<
Index() <<
" \nIndependent connect sequence numbers and indices ";
1562 std::map<int64_t,int64_t>::iterator mapit;
1563 for(mapit=independent.begin(); mapit!= independent.end(); mapit++)
1565 sout <<
"[" << mapit->first <<
" , " << mapit->second <<
"] ";
1567 if (logger->isDebugEnabled())
1577 std::map<int64_t,int64_t>::iterator mapit;
1578 for(mapit=independent.begin(); mapit!=independent.end(); mapit++)
1580 permute[mapit->first] = count++;
1584 std::stringstream sout;
1585 sout <<
"Index = " <<
Index() <<
" Permutation vector 1 " << permute;
1586 if (logger->isDebugEnabled())
1592 std::map<int64_t,int64_t> seqmap;
1596 int64_t seqnum =
fConnectVec[ind].SequenceNumber();
1597 if(seqnum == -1)
continue;
1600 for(mapit=seqmap.begin(); mapit!=seqmap.end(); mapit++)
1602 if(permute[mapit->first] == -1) permute[mapit->first] = count++;
1606 std::stringstream sout;
1607 sout <<
"Index = " <<
Index() <<
" Permutation vector 2 " << permute;
1608 if (logger->isDebugEnabled())
1633 int64_t i=0, numinternal=0, numconstraints = 0, numexternal=0;
1635 int64_t countconstraint=0;
1637 std::set<int64_t> internalseqnum;
1641 for(i=0;i<nconnects; i++){
1663 countconstraint = numinternal+numexternal;
1667 for (i=0;i<nconnects;i++) permute[i] = i;
1668 std::set<int64_t>::iterator it;
1670 for(it=internalseqnum.begin(); it!=internalseqnum.end(); it++)
1672 permute[*it] = seqnum++;
1675 if(logger->isDebugEnabled())
1677 std::stringstream sout;
1678 sout <<
" numinternal " << numinternal <<
" numconstraints " << numconstraints <<
" numexternal " << numexternal << std::endl;
1700 permute[seqnum] = countconstraint;
1715 if(logger->isDebugEnabled())
1717 std::stringstream sout;
1718 sout <<
"Index = " <<
" Permutations " << permute << std::endl;
1719 std::set<int64_t> permval;
1720 permval.insert(&permute[0], (&permute[permute.
size()-1]+1));
1721 sout <<
" Number of distinct values in permute " << permval.
size();
1742 size = (
Mesh()->
Block()).Size(seqnumext);
1747 for(l=0;l<size;l++) {
1748 fSolution(posint+l,0) = sol(posext+l,0);
1771 if (logger->isDebugEnabled()) {
1772 std::stringstream sout;
1777 for (int64_t iel = 0; iel < nel; iel++) {
1798 for (i=0; i< nmeshnodes; i++){
1806 if (blsize != dfsize) {
1870 const std::map<int, TPZMaterial *> &matmap =
fMaterialVec;
1873 for (std::map<int,TPZMaterial *>::const_iterator it = matmap.begin(); it != matmap.end(); it++) {
1874 matindex[count++] = it->first;
1876 buf.
Write( matindex);
1892 buf.
Read( matindex);
1893 int sz = matindex.
size();
1894 for (
int im=0; im<sz; im++) {
1905 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! This method is not implemented\n";
1910 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! This method is not implemented\n";
1917 PZError << __PRETTY_FUNCTION__ <<
" - ERROR! This method is not implemented\n";
1931 for(iel=0; iel<nel; iel++)
1944 std::set<int> meshmatids;
1949 int numtrue=0,numfalse=0;
1952 for(iel=0; iel<nelem; iel++)
1963 if(result) numtrue++;
1969 int matid = mat->
Id();
1970 meshmatids.insert(matid);
1971 if(matids.find(matid) != matids.end())
1982 std::stringstream sout;
1983 sout <<
"Material ids contained in the mesh ";
1984 std::set<int>::iterator it;
1985 for(it = meshmatids.begin(); it != meshmatids.end(); it++)
1989 sout << std::endl <<
"Material ids which should be computed ";
1990 std::set<int>::const_iterator it2;
1991 for(it2= matids.begin(); it2 != matids.end(); it2++)
1993 sout << *it2 <<
" ";
1998 if(numtrue && numfalse)
2000 std::stringstream sout;
2001 sout <<
"A substructure should have either all elements computable or not numtrue " << numtrue <<
" numfalse " << numfalse;
2022 for (i=0; i<numberexternal; i++) {
2030 for (i=0; i<nel; i++) {
2035 if (numext != numberexternal) {
2038 std::map<int64_t,int64_t>::iterator it;
2051 for (
int el=0; el<nel ; el++) {
2056 bool has_material_Q = cel->
HasMaterial(materialids);
2057 if (has_material_Q) {
2079 int nshape = nrigid;
2102 if (fathermesh && extind < 0) {
2105 while (fathermesh && extind > 0) {
2106 seqnum = fathermesh->
ConnectVec()[extind].SequenceNumber();
2107 fathermesh->
ConnectVec()[extind].SetLagrangeMultiplier(lagrange);
2108 fathermesh->
Block().
Set(seqnum, nrigid);
2127 for (
int el=0; el<nel ; el++) {
2132 std::set<int64_t> locconind;
2134 std::set<int64_t>::iterator it;
2135 for (it=locconind.begin(); it != locconind.end(); it++) {
2136 int64_t index = *it;
2138 if (extlocindex != -1) {
2140 connectindexes.insert(cornerind);
2160 int NErrors = errors.
size();
2163 int64_t index =
Index();
2165 if (elvals.
Cols() < NErrors) {
2166 std::cout <<
"The element solution of the mesh should be resized before EvaluateError\n";
2169 for (
int ier=0; ier <NErrors; ier++) {
2170 elvals(index,ier) = errors[ier];
int64_t NElements() const
Number of computational elements allocated.
TPZFMatrix< STATE > & ElementSolution()
Access method for the element solution vectors.
TPZGeoMesh * Reference() const
Returns a pointer to the geometrical mesh associated.
Represents a graphical mesh used for post processing purposes. Post processing.
virtual int64_t GetFromSuperMesh(int64_t superind, TPZCompMesh *super) override
Gets an external connection from the supermesh - Supermesh is one mesh who contains the analised subm...
TPZAutoPointer< TPZAnalysis > fAnalysis
Pointer to submesh analysis object. Defines the resolution type.
int AllocateNewElement()
Makes more room for new elements.
virtual TPZCompMesh * FatherMesh() const
Get the father meshes stack.
virtual TPZCompMesh * RootMesh(int64_t local) override
Returns the rootmesh who have the specified connection.
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const =0
adds the connect indexes associated with base shape functions to the set
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.
TPZAutoPointer< TPZMatrix< STATE > > Matrix()
int Set(const int index, const int dim, const int pos=-1)
Modifies existing block dimensions or creates a new block with given index.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
void SetName(const std::string &nm)
Set the mesh name.
Contains the TPZParSkylineStructMatrix class which defines parallel structural matrix for skyline mat...
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
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 VisualMatrix(TPZFMatrix< TVar > &matrix, const std::string &outfilename)
This function calls the function that create a Data Explorer file or VTK file that allow to visualiz...
TPZFMatrix< STATE > fSolution
Solution vector.
virtual void SetConnectIndex(int inode, int64_t index)=0
Set the index i to node inode.
virtual TPZVec< STATE > IntegrateSolution(const std::string &varname, const std::set< int > &matids) override
Compute the integral of a variable defined by the string if the material id is included in matids...
void Unwrap()
put the elements in the element group back in the mesh and delete the element group ...
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...
int64_t NodeIndex(int64_t nolocal, TPZCompMesh *super)
Gives the id node of one local node in containing mesh.
Analysis procedure to computational sub mesh. Analysis.
Contains the TPZFrontStructMatrix class which responsible for a interface among Finite Element Packag...
TPZAdmChunkVector< TPZCompEl * > fElementVec
List of pointers to elements.
virtual void CalcResidual(TPZElementMatrix &ef) override
Computes the element right hand side.
TPZManVector< int64_t > fConnectIndex
Pointer to external location index of the connection.
virtual int64_t AllocateNewConnect(int nshape, int nstate, int order) override
Virtual Method to allocate new connect.
int64_t NEquations()
This computes the number of equations associated with non-restrained nodes.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
TPZStack< int64_t > fConnect
Vector of pointers to TPZConnect objects.
virtual int64_t AllocateNewConnect(int nshape, int nstate, int order)
Returns an index to a new connect.
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override
Calculates the submesh stiffness matrix.
void SaddlePermute()
Put the sequence number of the pressure connects after the seq number of the flux connects...
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Implements a matrix stored in a frontal decomposition scheme. Frontal.
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
void InitializeEF(TPZElementMatrix &ef)
Initialize the datastructure of ef.
virtual void CreateGraphicalElement(TPZGraphMesh &graphmesh, int dimension) override
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
Defines step solvers class. Solver.
void SetSolver(TPZMatrixSolver< STATE > &solver)
Set solver matrix.
virtual void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual TPZEquationFilter & EquationFilter()
access method for the equation filter
void SetF(const TPZFMatrix< TVar > &F)
Copies the F vector in the internal data structure.
TPZVec< STATE > Integrate(const std::string &varname, const std::set< int > &matids)
Integrate the variable name over the mesh.
virtual int Dimension() const override
Virtual Method! See declaration in TPZCompEl class.
virtual void Print(std::ostream &out=std::cout) const override
Prints the submesh information on the specified device/file out.
virtual void Assemble()
Assemble the stiffness matrix and load vector.
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix< REAL > &axes) override
Computes solution and its derivatives in the local coordinate qsi. SHOULD NEVER BE CALLED...
virtual void CreateGraphicalElement(TPZGraphMesh &graphmesh, int dimension)
Creates corresponding graphical element(s) if the dimension matches graphical elements are used to ge...
int64_t fSingularConnect
Number of rigid body modes expected by the internal matrix inversion.
Class which groups elements to characterize dense 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.
REAL val(STATE &number)
Returns value of the variable.
virtual int64_t TransferElementFrom(TPZCompMesh *mesh, int64_t elindex)
Transfer one element from a specified mesh to the current submesh.
#define LOGPZ_WARN(A, B)
Define log for warnings.
void ComputeFillIn(int64_t resolution, TPZFMatrix< REAL > &fillin)
This method will fill the matrix passed as parameter with a representation of the fillin of the globa...
void SetGuiInterface(TPZAutoPointer< TPZGuiInterface > gui)
Defines gui interface object.
TPZBlock< STATE > fBlock
Block structure associated with fMat.
virtual void TransferMultiphysicsElementSolution() override
Transfer multiphysics solution.
TPZMatrixSolver< STATE > & Solver()
Get the solver matrix.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Contains the declaration of the VisualMatrix functions to VTK and DX packages.
void LoadReferences()
Map this grid in the geometric grid.
virtual ~TPZSubCompMesh()
Destructor.
void ReducedRightHandSide(TPZFMatrix< STATE > &rhs)
compute the reduced right hand side using the current stiffness. Abort if there is no stiffness compu...
void SetMesh(TPZCompMesh *mesh)
Sets the grid of the element.
void SetExact(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &result, TPZFMatrix< STATE > &deriv)> f)
Sets the pointer of the exact solution function.
virtual void TransferMultiphysicsElementSolution()
void PermuteInternalFirst(TPZVec< int64_t > &permute)
Permutes the potentially internal connects to the first on the list Respect the previous order of th...
Contains the TPZFStructMatrix class which implements Full Structural Matrices.
virtual int ClassId() const override
Define the class id associated with the class.
Implements SkyLine Structural Matrices. Structural Matrix.
TPZFMatrix< STATE > & Solution()
Returns the solution matrix.
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...
virtual void LoadElementReference() override
This method will load the elements of the mesh in their corresponding geometric elements.
TPZAutoPointer< TPZStructMatrix > StructMatrix()
Returns a reference to the structural matrix.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
virtual TPZMaterial * Material() const
Identify the material object associated with the element.
virtual void SetConnectIndex(int inode, int64_t index) override
Changes the current node index -inode- to the specified node- index.
virtual TPZCompMesh * FatherMesh() const override
Returns the current submesh father mesh.
void MakeExternal(int64_t local)
Changes an local internal connection to a external connection in the father mesh. ...
void Print(std::ostream &out)
int Zero() override
Makes Zero all the elements.
int64_t size() const
Returns the number of elements of the vector.
int64_t TransferElementTo(TPZCompMesh *mesh, int64_t elindex) override
Transfers one element from a submesh to another mesh.
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...
TPZSubCompMesh()
Default constructor.
TPZCompEl * Element(int64_t iel)
void CondensedSolution(TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
CondensedSolution: returns the condensed stiffness matrix - ek - and the condensed solution vector - ...
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.
void Unwrap()
unwrap the condensed element from the computational element and delete the condensed element ...
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 Read(TPZStream &buf, void *context) override
Read the element data from a stream.
void Push(const T object)
Pushes a copy of the object on the stack.
virtual void Skyline(TPZVec< int64_t > &skyline)
This method computes the skyline of the system of equations.
virtual void SkylineInternal(TPZVec< int64_t > &skyline)
This method computes the skyline of the system of equations.
virtual void LoadSolution()
Load the solution into the computable grid.
virtual void Write(const bool val)
Structure to reference dependency.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
virtual void EvaluateError(std::function< void(const TPZVec< REAL > &loc, TPZVec< STATE > &val, TPZFMatrix< STATE > &deriv)> func, TPZVec< REAL > &errors, bool store_error) override
Performs an error estimate on the elemen.
virtual bool HasMaterial(const std::set< int > &materialids) const
Verifies if the material associated with the element is contained in the set.
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 Read(TPZStream &buf, void *context) override
Read the element data from a stream.
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
virtual void ExpandSolution()
Adapt the solution vector to new block dimensions.
virtual void SetNumThreads(int n)
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
This class defines the boundary condition for TPZMaterial objects.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
Contains the TPZSkylineStructMatrix class which implements SkyLine Structural Matrices.
int Dimension() const
Returns the dimension of the simulation.
virtual void ComputeNodElCon()
Compute the number of elements connected to each connect object.
Contains the declaration of multiphysic interface class.
virtual void LoadSolution() override
Load the father mesh solution to all submesh connects - (internal and external).
std::map< int64_t, int64_t > fFatherToLocal
Maps indicating the correspondence between the connect index of the father mesh and de local connect ...
int64_t InternalIndex(int64_t IndexinFather)
return the index in the subcompmesh of a connect with index within the father
TPZMaterial * FindMaterial(int id)
Find the material with identity id.
virtual int64_t PutinSuperMesh(int64_t local, TPZCompMesh *super)
Put an local connection in the supermesh - Supermesh is one mesh who contains the analised submesh...
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
virtual void AutoBuild(const std::set< int > *MaterialIDs)
Creates the computational elements, and the degree of freedom nodes.
unsigned int NShape() const
int64_t Rows() const
Returns number of rows.
void SetIndex(int64_t index)
Sets element index of the mesh fELementVec list.
virtual void SetReferenceMatrix(TPZAutoPointer< TPZMatrix< TVar > > matrix)
This method gives a preconditioner to share a matrix with the referring solver object.
int HasDependency() const
Returns whether exist dependecy information.
void MakeInternalFast(int64_t local)
Marks the connect to be local.
virtual int ClassId() const override
Returns the unique identifier for reading/writing objects to streams.
virtual int64_t TransferElementTo(TPZCompMesh *mesh, int64_t elindex)
Transfer one element from a submesh to another mesh.
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 TransferDependencies(int64_t local)
Transfer the dependency list of a connect. This will make the dependency disappear for the correspond...
Contains TPZSkyline class which implements a skyline storage format.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
Class which implements an element which condenses the internal connects.
int64_t Index() const
Returns element index of the mesh fELementVec list.
virtual bool HasMaterial(const std::set< int > &materialids) const override
Verifies if the material associated with the element is contained in the set.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Analysis for substructuring. Use a frontal matrix. Analysis.
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
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.
TPZBlock< STATE > fBlock
Block structure to right construction of the stiffness matrix and load vector.
void PotentialInternal(std::list< int64_t > &connectindices) const
Puts the nodes which can be transferred in an ordered list.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
void CompactDataStructure(CompactScheme type=CompactScheme::ALWAYS)
Sets the method to compact the data structure based on the.
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.
void CondensedSolution(TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef)
CondensedSolution: returns the condensed stiffness matrix - ek - and the condensed solution vector - ...
virtual TPZFront< TVar > & GetFront()=0
void SetDimModel(int dim)
Set de dimension of the domain of the problem.
unsigned char NState() const
Number of state variables associated with the connect.
virtual void Run(std::ostream &out=std::cout)
Calls the appropriate sequence of methods to build a solution or a time stepping sequence.
bool NeedsComputing(const std::set< int > &matids) override
Verifies if any element needs to be computed corresponding to the material ids.
int32_t Hash(std::string str)
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
void PermuteExternalConnects()
Optimizes the connections positions on block.
virtual int64_t ConnectIndex(int i) const =0
Returns the index of the ith connectivity of the element.
Computes the contribution over an interface between two discontinuous elements. Computational Element...
bool AmIKilled()
Returns if the process was canceled through gui interface.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
static REAL angle
Angle in radians to test.
virtual int NConnects() const =0
Returns the number of nodes of the element.
Implements Full Structural Matrices. Structural Matrix.
TPZFNMatrix< 50, REAL > fDepMatrix
void ComputePermutationInternalFirst(TPZVec< int64_t > &permute) const
Computes the permutation vector which puts the internal connects to the first on the list Respect th...
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.
virtual void BuildCornerConnectList(std::set< int64_t > &connectindexes) const override
adds the connect indexes associated with base shape functions to the set
virtual void CleanUpUnconnectedNodes()
Delete the nodes which have no elements connected to them.
virtual void Assemble() override
Assemble the stiffness matrix in locally kept datastructure.
Implements a simple substructuring of a linear system of equations, composed of 4 submatrices...
int IsAllowedElement(TPZCompMesh *mesh, int64_t elindex)
Verifies the transfer possibility of the connection elindex from the mesh to the current submesh...
virtual void AssembleResidual()
Assemble the load vector.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
TPZCompEl * LeftElement() const
Returns the left element from the element interface.
This class implements a geometric mesh for the pz environment. Geometry.
virtual int64_t ConnectIndex(int i) const override
Returns the connection index i.
virtual REAL CompareMesh(int var, char *matname)
This method will initiate the comparison between the current computational mesh and the mesh which is...
void SetForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as source function for the material.
void SetMinMaxEq(int64_t mineq, int64_t maxeq)
Define as equacoes ativas de [mineq, maxeq)
Computes the contribution over an interface between two discontinuous elements. Computational Element...
virtual void ComputeNodElCon() override
Computes the number of elements connected to each connect object.
void Reset(TPZCompMesh *mesh=NULL, MType type=Unknown)
Reset the data structure.
TPZDepend * FirstDepend()
Contains TPZSubMeshFrontalAnalysis class which implements the analysis for substructuring.
static int main()
Static function for validation tests.
virtual void MakeAllInternal() override
Makes all mesh connections internal mesh connections.
virtual REAL CompareElement(int var, char *matname) override
This method will initiate the comparison between the current computational mesh and the mesh which is...
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<>
virtual int64_t TransferElement(TPZCompMesh *mesh, int64_t elindex) override
Transfer the element elindex belonging to mesh to the current mesh and returns its index...
virtual void Print(std::ostream &out=std::cout) const
Prints element data.
void SetAnalysisFrontal(int numThreads, TPZAutoPointer< TPZGuiInterface > guiInterface)
Sets the analysis type.
TPZCompEl * RightElement() const
Returns the right element from the element interface.
int NElConnected() const
Returns fNElConnected.
int64_t NumInternalEquations()
Computes the number of internal equations.
int NumLoadCases()
returns the number of load cases for this material object
Contains TPZStepSolver class which defines step solvers class.
int64_t Cols() const
Returns number of cols.
Derived class from TPZAnalysis implements non linear analysis (Newton's method). Analysis.
void SetFree(int index)
Indicate an element as free.
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
virtual void Print(std::ostream &out) const
Contains TPZSubMeshAnalysis class which implements the analysis procedure to computational sub mesh...
std::map< int, TPZMaterial *> fMaterialVec
Map of pointers to materials.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
TPZCompEl * RightElement() const
Returns the right element from the element interface.
static void Forcing(const TPZVec< REAL > &x, TPZVec< STATE > &disp)
Defining function force (external to material) .
void SetNumberRigidBodyModes(int nrigid, unsigned char lagrange=0)
Set the number of rigid body modes associated with the internal degrees of freedom.
void SetAnalysisSkyline(int numThreads, int preconditioned, TPZAutoPointer< TPZGuiInterface > guiInterface)
Condense the internal equations using a skyline symetric matrix the preconditioned argument indicates...
TPZFMatrix< STATE > & Rhs()
Returns the load vector.
void SetDirect(const DecomposeType decomp)
void InitializeBlock()
Resequence the block object, remove unconnected connect objects and reset the dimension of the soluti...
bool VerifyDatastructureConsistency()
Method to verify that the datastructures are consistent.
virtual void MakeInternal(int64_t local) override
Makes a specified connection a internal mesh connection.
void SetFront(TPZFront< STATE > &front)
Sets the front matrix.
virtual void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
void ResetReference()
Resets all load references in elements and nodes.
void Print(const TPZCompMesh &mesh, std::ostream &out=std::cout)
Print the information for the connect element.
Is a structural matrix with parallel techniques included. Structural Matrix Frontal.
Defines the interface of a computational element. Computational Element.
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
TPZManVector< int64_t > fExternalLocIndex
Indexes of the external connections.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
virtual TPZCompMesh * CommonMesh(TPZCompMesh *mesh) override
Gives the commom father mesh of the specified mesh and the current submesh.
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...
Contains the declaration of the TPZCondensedCompEl class, which implements an computational element w...
void SetRenumber(TPZAutoPointer< TPZRenumbering > renumber)
Change the renumbering scheme.
virtual void SetCompMesh(TPZCompMesh *mesh, bool mustOptimizeBandwidth)
Set the computational mesh of the analysis.
TPZFMatrix< STATE > & Solution()
Access the solution vector.
Contains the TPZParFrontStructMatrix class which is a structural matrix with parallel techniques incl...
virtual TPZMatrix< STATE > * Create() override
static void GatherDependency(TPZCompMesh &cmesh, TPZConnect &start, std::set< int64_t > &dependency)
void Write(TPZStream &buf, int withclassid) const override
Save the element data to a stream.
TPZAdmChunkVector< TPZConnect > fConnectVec
List of pointers to nodes.
Implements an interface to register a class id and a restore function. Persistence.
#define PZError
Defines the output device to error messages and the DebugStop() function.
void Reset()
Reset method.
virtual int64_t PutinSuperMesh(int64_t local, TPZCompMesh *super) override
Puts an local connection in the supermesh - Supermesh is one mesh who contains the analised submesh...
TPZMaterial * Material() const
virtual void Print(std::ostream &out=std::cout) const
Prints mesh data.
void SetGMRES(const int64_t numiterations, const int numvectors, const TPZMatrixSolver< TVar > &pre, const REAL tol, const int64_t FromCurrent)
virtual void Read(bool &val)
virtual int64_t GetFromSuperMesh(int64_t superind, TPZCompMesh *super)
Get an external connection from the supermesh - Supermesh is one mesh who contains the analised subme...
int64_t TransferElementFrom(TPZCompMesh *mesh, int64_t elindex) override
Transfers one element from a specified mesh to the current submesh.
void Permute(TPZVec< int64_t > &permute)
Permute the sequence number of the connect objects It is a permute gather operation.
virtual int NConnects() const override
Returns the number of connections.
Contains TPZNonLinearAnalysis class which implements the non linear analysis.
This class implements a reference counter mechanism to administer a dynamically allocated object...