12 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzelementgroup"));
17 TPZCompEl(), fElGroup(), fConnectIndexes()
35 for (
int el=0; el<nel; el++) {
38 for (
int el=0; el<nel; el++) {
48 std::set<int64_t> connects;
50 for (
int ic=0; ic<nc; ic++) {
54 for (
int ic=0; ic<nc; ic++) {
60 std::set<int64_t>::iterator it = connects.begin();
61 for (
int ic = 0; it != connects.end(); it++,ic++) {
65 int64_t elindex = cel->
Index();
68 for (std::list<TPZOneShapeRestraint>::iterator it=ellist.begin(); it != ellist.end(); it++) {
69 int64_t cindex = it->fFaces[0].first;
73 if (logger->isDebugEnabled())
75 std::stringstream sout;
76 sout <<
"Hiding element index " << elindex <<
" from the mesh data structure";
87 for (
int el=0; el<nel; el++) {
88 int64_t elindex =
fElGroup[el]->Index();
103 LOGPZ_ERROR(logger,
"SetConnectIndex should never be called")
119 std::map<int64_t,int64_t> & gl2lcConMap,
120 std::map<int64_t,int64_t> & gl2lcElMap)
const 125 for (
int el=0; el<nel; el++) {
138 std::map<int64_t,TPZOneShapeRestraint>::const_iterator it;
149 for (
int ic=0; ic<ncon; ic++) {
155 const int numloadcases = 1;
160 for(
int i=0; i<ncon; i++){
163 std::map<int64_t,TPZOneShapeRestraint>::const_iterator it;
177 std::map<int64_t,int64_t> locindex;
179 for (int64_t ic=0; ic<ncon ; ic++) {
183 if(logger->isDebugEnabled())
185 std::stringstream sout;
186 sout <<
"Calcstiff Element Group Index " <<
Index();
193 for (int64_t el = 0; el<nel; el++) {
204 if (logger->isDebugEnabled() ) {
209 std::stringstream sout;
211 sout <<
"Material id " << matid <<std::endl;
215 sout <<
"No associated geometry\n";
217 sout <<
"Connect indexes ";
223 sout <<
"Local indexes ";
236 for (
int ic=0; ic<nelcon; ic++) {
239 int ibldest = locindex[icindex];
243 for (
int jc = 0; jc<nelcon; jc++) {
246 int jbldest = locindex[jcindex];
248 for (
int jdf=0; jdf<jblsize; jdf++) {
256 if (logger->isDebugEnabled()) {
257 std::stringstream sout;
272 for (int64_t el = 0; el<nel; el++) {
279 bool has_material_Q = cel->
HasMaterial(materialids);
280 if (has_material_Q) {
294 std::map<int64_t,int64_t> locindex;
296 for (int64_t ic=0; ic<ncon ; ic++) {
302 for (int64_t el = 0; el<nel; el++) {
311 for (
int ic=0; ic<nelcon; ic++) {
314 int ibldest = locindex[icindex];
331 int nerr = errors.
size();
335 for (
int el=0; el<nel; el++) {
338 if (elref && elref->
Dimension() != meshdim) {
341 fElGroup[el]->EvaluateError(fp, errloc, store_error);
342 if (errloc.
size() != nerr) {
343 nerr = errloc.
size();
346 for (
int i=0; i<errloc.
size(); i++) {
347 errors[i] += errloc[i]*errloc[i];
350 for (
int i=0; i<errors.
size(); i++) {
351 errors[i] =
sqrt(errors[i]);
364 result =
fElGroup[el]->NeedsComputing(matids);
365 if (result ==
true) {
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...
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 int64_t ConnectIndex(int i) const override
Returns the index of the ith connectivity of the element.
int MaterialId() const
Returns the material index of the element.
void Unwrap()
put the elements in the element group back in the mesh and delete the element group ...
TPZStack< TPZCompEl *, 5 > fElGroup
virtual int NConnects() const override
Returns the number of nodes of the element.
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.
TPZStack< int64_t > fConnect
Vector of pointers to TPZConnect objects.
TPZManVector< int64_t, 27 > fConnectIndexes
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
virtual void CalcResidual(TPZElementMatrix &ef) override
Computes the element right hand side.
Contains the declaration of the TPZElementGroup class, which implements an computational element whic...
std::list< TPZOneShapeRestraint > fOneRestraints
list of one degree of freedom restraints
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef)
Computes the element stifness matrix and right hand side.
Class which groups elements to characterize dense matrices.
REAL val(STATE &number)
Returns value of the variable.
TPZBlock< STATE > fBlock
Block structure associated with fMat.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
virtual ~TPZElementGroup()
virtual int ClassId() const override
Define the class id associated with the class.
void Print(std::ostream &out)
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...
void Push(const T object)
Pushes a copy of the object on the stack.
int NConnects()
Returns the number of nodes of TElementMatrix.
virtual TPZCompEl * ClonePatchEl(TPZCompMesh &mesh, std::map< int64_t, int64_t > &gl2lcConMap, std::map< int64_t, int64_t > &gl2lcElMap) const override
Method for creating a copy of the element in a patch mesh.
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
virtual bool HasMaterial(const std::set< int > &materialids) const
Verifies if the material associated with the element is contained in the set.
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
int Dimension() const
Returns the dimension of the simulation.
unsigned int NShape() const
int64_t Rows() const
Returns number of rows.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
int64_t Index() const
Returns element index of the mesh fELementVec list.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
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.
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
unsigned char NState() const
Number of state variables associated with the connect.
int32_t Hash(std::string str)
virtual int64_t ConnectIndex(int i) const =0
Returns the index of the ith connectivity of the element.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
virtual void SetConnectIndex(int inode, int64_t index) override
Set the index i to node inode.
virtual int NConnects() const =0
Returns the number of nodes of the element.
virtual void CalcStiff(TPZElementMatrix &ek, TPZElementMatrix &ef) override
Computes the element stifness matrix and right hand side.
virtual std::list< TPZOneShapeRestraint > GetShapeRestraints() const
Return a list with the shape restraints.
virtual int Dimension() const =0
Returns the dimension of the element.
virtual void CalcResidual(TPZElementMatrix &ef)
Computes the element right hand side.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
This class implements a stack object. Utility.
virtual int ClassId() const override
Define the class id associated with the class.
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.
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.
void InitializeElementMatrix(TPZElementMatrix &ek, TPZElementMatrix &ef) const
Initialize the datastructure of ek and ef based on the connect information.
virtual void Print(std::ostream &out) const
void Print(const char *title="", TPZostream &out=std::cout, TPZMatrix< TVar > *mat=NULL)
Prints all the blocks of the matrix.
Defines the interface of a computational element. Computational Element.
virtual void AddElement(TPZCompEl *cel)
add an element to the element group
bool NeedsComputing(const std::set< int > &matids) override
Verifies if any element needs to be computed corresponding to the material ids.
virtual bool HasMaterial(const std::set< int > &materialids) const override
Verifies if the material associated with the element is contained in the set.
std::map< int64_t, TPZOneShapeRestraint > fRestraints