46 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzcompel"));
57 for (i = 0; i<nu1; i++) u12[i] = u1[i];
58 for (i = 0; i<nu2; i++) u12[i + nu1] = u2[i];
65 int64_t ru12 = ru1 < ru2 ? ru2 : ru1;
66 int64_t cu12 = cu1 + cu2;
67 u12.
Redim(ru12, cu12);
69 for (i = 0; i<ru1; i++)
for (j = 0; j<cu1; j++) u12(i, j) = u1(i, j);
70 for (i = 0; i<ru2; i++)
for (j = 0; j<cu2; j++) u12(i, j + cu1) = u2(i, j);
77 for (i = 0; i < n; i++) {
78 if (
fabs(A[i] - B[i]) > tol)
return false;
83 template<
class TCOMPEL>
87 if (!refmesh)
return NULL;
93 template<
class TCOMPEL>
95 out <<
"\n" << __PRETTY_FUNCTION__ <<
"\n";
102 out <<
"My ReferredEl = " << other <<
"\n";
104 else out <<
"My ReferredEl = " << 0 <<
"\n";
105 out <<
"end of " << __PRETTY_FUNCTION__ <<
"\n";
108 template<
class TCOMPEL>
110 TCOMPEL(mesh, gel,index){
114 template<
class TCOMPEL>
120 template<
class TCOMPEL>
126 template<
class TCOMPEL>
129 std::map<int64_t,int64_t> & gl2lcConMap,
130 std::map<int64_t,int64_t> & gl2lcElMap):
132 TCOMPEL(mesh,copy,gl2lcConMap,gl2lcElMap)
137 template<
class TCOMPEL>
149 template <
class TCOMPEL >
160 other->InitMaterialData(otherdata);
161 other->ComputeShape(qsi,otherdata);
162 other->ComputeSolution(qsi,otherdata);
168 int64_t numbersol = sol.
size();
169 OtherDSol2.
resize(numbersol);
170 for (int64_t is=0; is<numbersol; is++) {
171 if(sol[is].NElements()){
175 OtherDSol2[is] = otherdata.
dsol[is];
177 axes = otherdata.
axes;
180 ::Append(ThisDSol[is],OtherDSol2[is],dsol[is]);
184 template <
class TCOMPEL >
195 other->ComputeSolution(qsi, OtherSol, OtherDSol, otheraxes);
196 int64_t numbersol = sol.
size();
197 for (int64_t is=0; is<numbersol; is++) {
198 ::Append(ThisSol[is],OtherSol[is],sol[is]);
202 template <
class TCOMPEL >
211 int64_t numbersol = sol.
size();
216 other->ComputeSolution(qsi, OtherSol, OtherDSol, otheraxes);
217 for (int64_t is=0; is<numbersol; is++) {
218 if(sol[is].NElements()){
221 else if(OtherSol[is].NElements()){
222 OtherDSol2[is] = OtherDSol[is];
225 ::Append(ThisSol[is],OtherSol[is],sol[is]);
226 ::Append(ThisDSol[is],OtherDSol2[is],dsol[is]);
230 template <
class TCOMPEL >
238 TPZSolVec ThisLeftSol(leftsol), ThisRightSol(rightsol);
239 TPZGradSolVec ThisDLeftSol(dleftsol), ThisDRightSol(drightsol);
241 TPZSolVec OtherLeftSol(0), OtherRightSol(0);
243 TPZGradSolVec OtherDSol2(0), OtherDLeftSol(0), OtherDLeftSol2(0), OtherDRightSol(0), OtherDRightSol2(0);
245 other->ComputeSolution(qsi, OtherNormal,
246 OtherLeftSol, OtherDLeftSol, OtherLeftAxes,
247 OtherRightSol, OtherDRightSol, OtherRightAxes);
249 if (OtherLeftSol.NElements() || OtherRightSol.
NElements()) {
251 if ( !
AreEqual(normal,OtherNormal) ) {
252 PZError <<
"\nFATAL ERROR at " << __PRETTY_FUNCTION__ <<
"\n";
256 normal = OtherNormal;
260 int64_t numbersol = ThisLeftSol.
size();
261 for (int64_t is=0; is<numbersol; is++) {
265 else if(OtherLeftSol.NElements()){
266 OtherDLeftSol2[is] = OtherDLeftSol[is];
267 leftaxes = OtherLeftAxes;
274 OtherDRightSol2[is] = OtherDRightSol[is];
275 rightaxes = OtherRightAxes;
277 ::Append(ThisLeftSol[is], OtherLeftSol[is], leftsol[is]);
278 ::Append(ThisDLeftSol[is], OtherDLeftSol[is], dleftsol[is]);
279 ::Append(ThisRightSol[is], OtherRightSol[is], rightsol[is]);
280 ::Append(ThisDRightSol[is], OtherDRightSol[is], drightsol[is]);
289 template<
class TCOMPEL >
316 template<
class TCOMPEL >
319 TCOMPEL::ComputeSolution(qsi,data);
331 template<
class TCOMPEL >
336 TCOMPEL::ComputeSolution(qsi, normal, leftsol, dleftsol, leftaxes, rightsol, drightsol, rightaxes);
337 this->
AppendOtherSolution(qsi, normal, leftsol, dleftsol, leftaxes, rightsol, drightsol, rightaxes);
340 template<
class TCOMPEL>
342 return Hash(
"TPZReferredCompEl") ^ TCOMPEL::ClassId() << 1;
350 axesto.
MultAdd(axesfromlocal,axesinner,axesinner,1.,0.);
351 int64_t nderiv = dsolfrom.
Rows();
352 int64_t nstate = dsolfrom.
Cols();
353 dsolto.
Resize(nderiv,nstate);
355 for(is=0; is<nstate; is++)
358 for(
id=0;
id<nderiv;
id++)
360 for(jd=0; jd<nderiv; jd++)
362 dval[id] += dsolfrom(jd,is)*(STATE)axesinner(
id,jd);
365 for(
id=0;
id<nderiv;
id++)
367 dsolto(
id,is) = dval[id];
TPZCompEl * CreateReferredPyramEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates pyramidal referred computational element related with geometric element gel.
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
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 the TPZInt1d, TPZIntTriang, TPZIntQuad, TPZIntCube3D, TPZIntTetra3D, TPZIntPyram3D and TPZIn...
Contains declaration of TPZIntelGen class which implements a generic computational element...
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.
TPZCompEl * ReferredEl(int64_t index)
virtual void ComputeSolution(TPZVec< REAL > &qsi, TPZMaterialData &data) override
Computes solution and its derivatives in local coordinate qsi.
int ClassId() const override
virtual void resize(const int64_t newsize)
void Append(TPZVec< TVar > &u1, TPZVec< TVar > &u2, TPZVec< TVar > &u12)
Append u2 vector after u1 vector in u12 vector.
groups all classes dedicated to the computation of shape functions
bool AreEqual(const TPZVec< REAL > &A, const TPZVec< REAL > &B, REAL tol)
Returns true whether for all the entries of the matrices.
TPZGradSolVec dsol
vector of the derivatives of the solution at the integration point
MShapeFunctionType fShapeType
TPZCompEl * CreateReferredTriangleEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates triangular referred computational element related with geometric element gel.
Contains declaration of TPZCompElHDiv class which implements a generic computational element (HDiv sc...
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
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 SetAllCreateFunctionsDiscontinuousReferred()
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Contains declaration of TPZCompMeshReferred class which implements the structure to allow one mesh to...
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
#define DebugStop()
Returns a message to user put a breakpoint in.
Contains declaration of TPZInterfaceElement class which computes the contribution over an interface b...
virtual void SetCreateFunctions(TPZCompMesh *mesh) override
Set create function in TPZCompMesh to create elements of this type.
Implements the structure to allow one mesh to refer to the solution of another. Geometry.
int64_t Rows() const
Returns number of rows.
TPZFNMatrix< 9, REAL > axes
axes indicating the directions of the derivatives of the shapefunctions
Contains declaration of TPZCompelDisc class which implements a computational element for discontinuou...
Contains TPZShapePoint class which implements the shape function associated with a point...
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Full matrix class. Matrix.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
int32_t Hash(std::string str)
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
Contains TPZShapePrism class which implements the shape functions of a prism element.
void AppendOtherSolution(TPZVec< REAL > &qsi, TPZSolVec &sol, TPZGradSolVec &dsol, TPZFMatrix< REAL > &axes)
Append solution of the referred element.
~TPZReferredCompEl()
Class destructor.
TPZCompEl * CreateReferredPointEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates point referred computational element related with geometric element gel.
virtual void Print(std::ostream &out=std::cout) const override
Prints element data.
TPZCompEl * CreateReferredTetraEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates tetrahedral referred computational element related with geometric element gel...
Contains declaration of TPZCompElHDivBound2 class which implements a generic computational element (H...
Template to generate computational elements. Computational Element.
Implements computational mesh. Computational Mesh.
TPZCompEl * CreateReferredQuadEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates quadrilateral referred computational element related with geometric element gel...
TPZCompEl * CreateReferredLinearEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates linear referred computational element related with geometric element gel. ...
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
virtual void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha=1., const TVar beta=0., const int opt=0) const override
It computes z = beta * y + alpha * opt(this)*x but z and x can not overlap in memory.
int64_t Cols() const
Returns number of cols.
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
TPZCompEl * CreateReferredCubeEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates cube referred computational element related with geometric element gel.
int64_t NElements() const
Returns the number of elements of the vector.
void SetAllCreateFunctionsContinuousReferred()
Contains the TPZGeoPrism class which implements the geometry of a prism element.
Contains declaration of TPZReferredCompEl class which generates computational elements.
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
TPZCompEl * ReferredElement()
Returns referred element of this.
TPZCompEl * CreateReferredPrismEl(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates prismal referred computational element related with geometric element gel.
Groups all classes which model the geometry.
Defines the interface of a computational element. Computational Element.
TPZSolVec sol
vector of the solutions at the integration point
TPZCompEl * CreateReferredDisc(TPZGeoEl *gel, TPZCompMesh &mesh, int64_t &index)
Creates discontinuous referred computational element related with geometric element gel...
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
void Transpose(TPZMatrix< TVar > *const T) const override
It makes *T the transpose of current matrix.
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
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 AdjustSolutionDerivatives(TPZFMatrix< STATE > &dsolfrom, TPZFMatrix< REAL > &axesfrom, TPZFMatrix< STATE > &dsolto, const TPZFMatrix< REAL > &axesto)
Adjust the derivatives from one system of axes to the other.