12 static LoggerPtr logger(Logger::getLogger(
"pz.topology.prismextend"));
17 template<
class TFather>
22 template<
class TFather>
27 template<
class TFather>
30 int ftns = side/TFather::NSides;
31 if(ftns < 2)
return TFather::NSideNodes(side % TFather::NSides);
32 return TFather::NSideNodes(side % TFather::NSides) *2;
35 template<
class TFather>
38 int ftns = side/TFather::NSides;
40 if(ftns == 0)
return TFather::SideNodeLocId(side,node);
41 if(ftns == 1)
return TFather::SideNodeLocId(side-TFather::NSides,node)+TFather::NCornerNodes;
42 int fatherlevel = node/TFather::NSideNodes(fatherside);
43 if(fatherlevel == 0)
return TFather::SideNodeLocId(fatherside,node);
44 if(fatherlevel == 1)
return TFather::SideNodeLocId(fatherside,node-TFather::NSideNodes(fatherside))+TFather::NCornerNodes;
45 PZError <<
"Pr<TFather>::SideNodeLocId inconsistent side or node " << side
46 <<
' ' << node << endl;
50 template<
class TFather>
52 if(side<0 || side >= NSides) {
53 PZError <<
"Pr<TFather>::SideDimension side " << side << endl;
56 int ftns = side/TFather::NSides;
58 if(ftns < 2)
return TFather::SideDimension(fatherside);
59 return TFather::SideDimension(fatherside)+1;
62 template<
class TFather>
65 if(side <0 || side >= NSides) {
66 PZError <<
"Pr<TFather>::HigherDimensionSides side "<< side << endl;
68 int ftns = side/TFather::NSides;
71 TFather::HigherDimensionSides(fatherside,high);
76 high.
Push(fatherside+2*TFather::NSides);
77 for(is=nhbefore; is<nhafter; is++)
79 high.
Push(high[is]+2*TFather::NSides);
80 high[is] += ftns*TFather::NSides;
85 for(is=nhbefore; is<nhafter; is++)
87 high[is] += ftns*TFather::NSides;
92 template<
class TFather>
94 if (center.
size()!=Dimension) {
97 int ftns = side/TFather::NSides;
99 TFather::CenterPoint(fatherside,center);
103 center[Dimension-1] = -1.;
106 center[Dimension-1] = 1.;
110 center[Dimension-1] = 0.;
114 template<
class TFather>
117 if(side<0 || side>=NSides)
119 PZError <<
"Pr<TFather>::TransformElementToSide called with side error\n";
123 int sidedim = SideDimension(side);
125 if(side == NSides)
return t;
126 int ftns = side/TFather::NSides;
128 TPZTransform<> fathert = TFather::TransformElementToSide(fatherside);
129 int fathersidedimension = sidedim;
130 if(ftns == 2) fathersidedimension--;
132 for(
id=0;
id<fathersidedimension;
id++)
134 t.
Sum()(id,0) = fathert.
Sum()(id,0);
135 for(jd=0; jd<TFather::Dimension; jd++)
137 t.
Mult()(id,jd) = fathert.
Mult()(id,jd);
142 t.
Mult()(sidedim-1,Dimension-1) = 1.;
147 template<
class TFather>
150 if(side<0 || side>=NSides){
151 PZError <<
"Pr<TFather>::TransformSideToElement side out range\n";
154 int sidedim = SideDimension(side);
156 if(Dimension == sidedim)
return t;
157 int ftns = side/TFather::NSides;
159 TPZTransform<> fathert = TFather::TransformSideToElement(fatherside);
160 int fathersidedimension = sidedim;
161 if(ftns == 2) fathersidedimension--;
163 for(
id=0;
id<TFather::Dimension;
id++)
165 t.
Sum()(id,0) = fathert.
Sum()(id,0);
166 for(jd=0; jd<fathersidedimension; jd++)
168 t.
Mult()(id,jd) = fathert.
Mult()(id,jd);
174 t.
Sum()(Dimension-1,0) = -1.;
177 t.
Sum()(Dimension-1,0) = 1.;
180 t.
Mult()(Dimension-1,sidedim-1) = 1.;
187 template<
class TFather>
190 if(sidefrom <0 || sidefrom >= NSides || sideto <0 || sideto >= NSides) {
191 PZError <<
"Pr<TFather>::HigherDimensionSides sidefrom "<< sidefrom <<
192 ' ' << sideto << endl;
195 if(sidefrom == sideto) {
198 if(sidefrom == NSides-1) {
199 return TransformElementToSide(sideto);
202 HigherDimensionSides(sidefrom,highsides);
205 for(is=0; is<nhigh; is++) {
206 if(highsides[is] == sideto) {
207 int dfr = SideDimension(sidefrom);
208 int dto = SideDimension(sideto);
209 TPZTransform<> trans(dto,dfr),toelement(Dimension,sidefrom),toside(sideto,Dimension);
210 toelement = TransformSideToElement(sidefrom);
211 toside = TransformElementToSide(sideto);
216 PZError <<
"Pr<TFather>::SideToSideTransform highside not found sidefrom " 217 << sidefrom <<
' ' << sideto << endl;
221 template<
class TFather>
223 return TFather::NumSides()*3;
227 template<
class TFather>
229 int ftns = side/TFather::NSides;
231 if(ftns<2)
return TFather::NContainedSides(fatherside);
232 return TFather::NContainedSides(fatherside)*3;
235 template<
class TFather>
237 int nsconnect = NContainedSides(side);
240 PZError <<
"Pr<TFather>::ContainedSideLocId, side = " << side <<
" connect = " << c << endl;
243 int ftns = side/TFather::NSides;
245 if(ftns == 0)
return TFather::ContainedSideLocId(fatherside,c);
246 if(ftns == 1)
return TFather::ContainedSideLocId(fatherside,c)+TFather::NSides;
247 int nsideconfather = TFather::NContainedSides(fatherside);
248 int confather = c%nsideconfather;
249 int level = c/nsideconfather;
250 return TFather::ContainedSideLocId(fatherside,confather)+level*TFather::NSides;
253 template<
class TFather>
257 int nsidecon = NContainedSides(side);
259 for(is=0; is<nsidecon-1; is++)
260 smallsides.
Push(ContainedSideLocId(side,is));
263 template<
class TFather>
267 int nsidecon = NContainedSides(side);
268 for(
int is = 0; is < nsidecon - 1; is++) {
269 if (SideDimension(ContainedSideLocId(side,is)) == DimTarget) smallsides.
Push(ContainedSideLocId(side,is));
274 template<
class TFather>
277 return 2.0*TFather::RefElVolume();
280 template<
class TFather>
283 TPZIntPoints *integ = TFather::CreateSideIntegrationRule(side%TFather::NSides,order);
284 if(side< 2*TFather::NSides) {
293 template<
class TFather>
299 template<
class TFather>
302 if(side < 2*TFather::NSides)
309 template<
class TFather>
312 SidePar.
Resize(SideDimension(side));
313 Transf.
Apply(InternalPar,SidePar);
315 JacToSide = Transf.
Mult();
321 template<
class TFather>
325 if (logger->isDebugEnabled())
327 std::stringstream sout;
328 sout << __PRETTY_FUNCTION__ ;
329 sout <<
" Dimension : " << Dimension <<
" NCornerNodes " << NCornerNodes <<
330 " NSides " << NSides;
334 if (logger->isDebugEnabled())
336 std::stringstream sout;
337 sout <<
"Testing smallsides\n";
340 for(is=0; is<NSides; is++)
342 LowerDimensionSides(is,smallsides);
343 sout <<
" side " << is <<
" allsmallsides " << smallsides << endl;
345 for(
id=0;
id < SideDimension(is);
id++)
348 LowerDimensionSides(is,smallsides,
id);
349 sout <<
" side " << is <<
" targetdimension " <<
id <<
" smallsides " << smallsides << endl;
356 if (logger->isDebugEnabled())
358 std::stringstream sout;
359 sout <<
"Testing HigherDimensionSides\n";
361 for(is=0; is<NSides; is++)
364 HigherDimensionSides(is,high);
365 sout <<
"Side " << is <<
" higherdimensionsides " << high << endl;
370 if (logger->isDebugEnabled())
372 std::stringstream sout;
373 sout <<
"Testing NSideNodes\n";
375 for(is=0; is<NSides; is++)
377 sout <<
"Side " << is <<
" NSideNodes " << NSideNodes(is) << endl;
385 if (logger->isDebugEnabled())
387 std::stringstream sout;
388 sout <<
"Testing SideNodeLocId\n";
390 for(is=0; is<NSides; is++)
392 int nsnodes = NSideNodes(is);
394 sout <<
"Side " << is <<
" sidenodelocid ";
395 for(sn=0; sn<nsnodes; sn++)
397 sout << SideNodeLocId(is,sn) <<
" ";
404 if (logger->isDebugEnabled())
406 std::stringstream sout;
407 sout <<
"Testing CenterPoint\n";
409 for(is=0; is<NSides; is++)
412 CenterPoint(is,center);
413 sout <<
"Side " << is << center << endl;
418 if (logger->isDebugEnabled())
420 std::stringstream sout;
421 sout <<
"Testing RefelVolume\n";
422 sout <<
"Volume " << RefElVolume() << endl;
426 if (logger->isDebugEnabled())
428 std::stringstream sout;
429 sout <<
"Testing SideDimension\n";
431 for(is=0; is<NSides; is++)
433 sout <<
"Side " << is <<
" sidedimension " << SideDimension(is) << endl;
439 if (logger->isDebugEnabled())
441 std::stringstream sout;
442 sout <<
"Testing SideToSideTransform\n";
444 for(is=0; is<NSides; is++)
447 LowerDimensionSides(is,lower);
450 for(il=0; il<nl; il++)
453 tr = SideToSideTransform(is,lower[il]);
454 sout <<
"Transform from " << is <<
" to side " << lower[il] <<
" " << tr;
460 if (logger->isDebugEnabled())
462 std::stringstream sout;
463 sout <<
"Testing TransformElementToSide\n";
465 for(is=0; is<NSides; is++)
468 sout <<
"side " << is <<
" transform " << tr;
473 if (logger->isDebugEnabled())
475 std::stringstream sout;
476 sout <<
"Testing TransformSideToElement\n";
478 for(is=0; is<NSides; is++)
480 sout <<
"side " << is <<
" transform " << TransformSideToElement(is);
486 if (logger->isDebugEnabled())
488 std::stringstream sout;
489 sout <<
"Testing CreateSideIntegrationRule order 3\n";
491 for(is=0; is<NSides; is++)
494 sout <<
"side " << is << endl;
502 if (logger->isDebugEnabled())
504 std::stringstream sout;
505 sout <<
"Testing StrType\n";
511 if (logger->isDebugEnabled())
513 std::stringstream sout;
514 sout <<
"Testing StrType(side)\n";
516 for(is=0; is<NSides; is++)
518 sout <<
"side " << is <<
" type " << StrType(is) << endl;
524 if (logger->isDebugEnabled())
526 std::stringstream sout;
528 sout <<
"Testing MapToSide internalpar = " << par <<
"\n";
530 for(is=0; is<NSides; is++)
534 MapToSide(is,par,sidepar,jactoside);
535 sout <<
"side " << is <<
" sidepar " << sidepar <<
" jactoside " << jactoside << endl;
541 if (logger->isDebugEnabled())
543 std::stringstream sout;
544 sout <<
"Testing NumSides\n";
545 sout <<
"nsides " << NumSides();
550 if (logger->isDebugEnabled())
552 std::stringstream sout;
553 sout <<
"Testing NContainedSides(side)\n";
555 for(is=0; is<NSides; is++)
557 sout <<
"side " << is <<
" nsideconnects " << NContainedSides(is) << endl;
562 if (logger->isDebugEnabled())
564 std::stringstream sout;
565 sout <<
"Testing ContainedSideLocId(is,ic)\n";
567 for(is=0; is<NSides; is++)
569 int nc = NContainedSides(is);
570 sout <<
"side " << is <<
" connects ";
571 for(ic=0; ic<nc; ic++)
573 sout << ContainedSideLocId(is,ic) <<
" ";
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.
Contains the TPZPoint class which defines the topology of a point.
std::string MElementType_Name(MElementType elType)
Returns the name of the element type.
virtual TPZIntPoints * PrismExtend(int order)=0
static int fatherside[8][21]
Contains the Pr class(template) which defines the Prismatic extension of a topology.
virtual void Print(std::ostream &out) const
Prints information of the cubature rule.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Abstract class defining integration rules. Numerical Integration.
static int highsides[27][7]
For each side was stored the sides connected with it but of the higher dimension. ...
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...
Groups all classes defining the structure of the master element.
void Push(const T object)
Pushes a copy of the object on the stack.
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
Defines the Prismatic extension of a topology. Topology.
int64_t NElements() const
Returns the number of elements of the vector.
#define PZError
Defines the output device to error messages and the DebugStop() function.