22 static LoggerPtr logger(Logger::getLogger(
"pz.topology.pzline"));
41 {{0,0,0},{0,0,0},{0,0,0},{-1,0,0}}
44 {{0,0,0},{0,0,0},{0,0,0},{1,0,0}}
47 {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}}
54 int TPZLine::fPermutations [2][3] =
60 int TPZLine::NBilinearSides()
71 phi(0,0) = (1.0-x)/2.;
72 phi(1,0) = (1.0+x)/2.;
78 void TPZLine::BlendFactorForSide(
const int &side,
const TPZVec<T> &xi, T &blendFactor,
82 std::ostringstream sout;
83 if(side < NCornerNodes || side >= NSides){
84 sout<<
"The side\t"<<side<<
"is invalid. Aborting..."<<std::endl;
85 PZError<<std::endl<<sout.str()<<std::endl;
89 if(!TPZLine::IsInParametricDomain(xi,tol)){
90 sout<<
"The method BlendFactorForSide expects the point xi to correspond to coordinates of a point";
91 sout<<
" inside the parametric domain. Aborting...";
92 PZError<<std::endl<<sout.str()<<std::endl;
101 TPZLine::TShape(xi,phi,dphi);
102 blendFactorDxi.
Resize(TPZLine::Dimension, (T) 0);
105 blendFactor = phi(0,0);
106 blendFactorDxi[0] = dphi(0,0);
109 blendFactor = phi(1,0);
110 blendFactorDxi[0] = dphi(0,1);
114 blendFactorDxi[0] = 0;
120 int TPZLine::NSideNodes(
int side)
122 return nsidenodes[side];
126 if(dimension<0 || dimension> 1) {
127 PZError <<
"TPZLine::NumSides. Bad parameter i.\n";
130 if(dimension==0)
return 2;
131 if(dimension==1)
return 1;
139 int nsidecon = NContainedSides(side);
141 for(is=0; is<nsidecon-1; is++)
142 smallsides.
Push(ContainedSideLocId(side,is));
145 void TPZLine::LowerDimensionSides(
int side,
TPZStack<int> &smallsides,
int DimTarget)
148 int nsidecon = NContainedSides(side);
149 for(
int is = 0; is < nsidecon - 1; is++) {
150 if (SideDimension(ContainedSideLocId(side,is)) == DimTarget) smallsides.
Push(ContainedSideLocId(side,is));
155 const REAL qsi = pt[0];
156 if(
fabs(qsi) <= 1. + tol){
165 bool TPZLine::CheckProjectionForSingularity(
const int &side,
const TPZVec<T> &xiInterior) {
174 SidePar.
Resize(SideDimension(side));
175 Transf.
Apply(InternalPar,SidePar);
177 JacToSide = Transf.
Mult();
180 void TPZLine::ParametricDomainNodeCoord(
int node,
TPZVec<REAL> &nodeCoord)
182 if(node > NCornerNodes)
186 nodeCoord.
Resize(Dimension, 0.);
208 if(side <0 || side >= NSides) {
209 PZError <<
"TPZLine::HigherDimensionSides side "<< side << endl;
212 for(is=0; is<nhighdimsides[side]; is++) high.
Push(highsides[side][is]);
216 int TPZLine::SideNodeLocId(
int side,
int node)
218 if(side <2 && node == 0)
return side;
219 if(side == 2 && node <2)
return node;
220 PZError <<
"TPZLine::SideNodeLocId inconsistent side or node " << side
221 <<
' ' << node << endl;
225 if (center.
size()!=Dimension) {
229 for(i=0; i<Dimension; i++) {
230 center[i] = MidSideNode[side][i];
238 for(
int i=0; i<1; i++)
240 REAL
val = -1. + 2.*(REAL) rand() / (RAND_MAX);
245 int TPZLine::SideDimension(
int side) {
246 if(side<0 || side >= NSides) {
247 PZError <<
"TPZLine::SideDimension side " << side << endl;
250 return sidedimension[side];
255 if(sidefrom <0 || sidefrom >= NSides || sideto <0 || sideto >= NSides) {
256 PZError <<
"TPZLine::HigherDimensionSides sidefrom "<< sidefrom <<
257 ' ' << sideto << endl;
260 if(sidefrom == sideto) {
263 if(sidefrom == NSides-1) {
264 return TransformElementToSide(sideto);
267 if (sideto == NSides -1) {
268 return TransformSideToElement(sidefrom);
271 int nhigh = nhighdimsides[sidefrom];
273 for(is=0; is<nhigh; is++) {
274 if(highsides[sidefrom][is] == sideto) {
275 int dfr = sidedimension[sidefrom];
276 int dto = sidedimension[sideto];
279 for(i=0; i<dto; i++) {
280 for(j=0; j<dfr; j++) {
281 trans.
Mult()(i,j) = sidetosidetransforms[sidefrom][is][j][i];
283 trans.
Sum()(i,0) = sidetosidetransforms[sidefrom][is][3][i];
288 PZError <<
"TPZLine::SideToSideTransform highside not found sidefrom " 289 << sidefrom <<
' ' << sideto << endl;
295 if(side<0 || side>2){
296 PZError <<
"TPZLine::TransformElementToSide called with side error\n";
318 if(side<0 || side>2){
319 PZError <<
"TPZLine::TransformSideToElement side out range\n";
323 if(side <2) sidedim = 0;
344 TPZIntPoints *TPZLine::CreateSideIntegrationRule(
int side,
int order) {
346 if(side<0 || side>2) {
347 PZError <<
"TPZLine::CreateSideIntegrationRule wrong side " << side << endl;
376 int TPZLine::NumSides() {
381 int TPZLine::NContainedSides(
int side) {
382 if(side==0 || side==1)
return 1;
383 else if(side==2)
return 3;
384 PZError <<
"TPZLine::NContainedSides. Bad parameter side = " << side <<
" .\n";
389 int TPZLine::ContainedSideLocId(
int side,
int c) {
395 PZError <<
"TPZLine::ContainedSideLocId, connect = " << c << endl;
401 PZError <<
"TPZLine::ContainedSideLocId called with side = " << side << endl;
414 return id[0] <
id[1] ? 0 : 1;
431 return id[0] <
id[1] ? 0 : 1;
447 void TPZLine::GetSideHDivPermutation(
int transformationid,
TPZVec<int> &permgather)
450 for (
int i=0; i<3; i++)
452 permgather[i] = fPermutations[transformationid][i];
490 for (
int i = 0; i<3; i++)
492 norma += bvec(i,0)*bvec(i,0);
496 directions.
Redim(3, 1);
497 for (
int i=0; i<3; i++)
499 directions(i,0) = bvec(i,0)/norma;
508 int nsides = NumSides();
515 for (
int is = 0; is<nsides; is++)
517 sides[is] = vectorsideorder[is];
518 dir[is] = direcaoksioueta[is];
519 bilounao[is] = bilinearounao[is];
525 int nsides = NumSides();
531 for (
int is = 0; is<nsides; is++)
533 sides[is] = vectorsideorder[is];
534 dir[is] = direcaoksioueta[is];
535 bilounao[is] = bilinearounao[is];
536 sidevectors[is] = is;
540 int TPZLine::ClassId()
const{
541 return Hash(
"TPZLine");
548 void TPZLine::Write(
TPZStream& buf,
int withclassid)
const {
559 template bool pztopology::TPZLine::CheckProjectionForSingularity<REAL>(
const int &side,
const TPZVec<REAL> &xiInterior);
563 template void pztopology::TPZLine::BlendFactorForSide<REAL>(
const int &,
const TPZVec<REAL> &, REAL &, TPZVec<REAL> &);
570 template bool pztopology::TPZLine::CheckProjectionForSingularity<Fad<REAL>>(
const int &side,
const TPZVec<Fad<REAL>> &xiInterior);
575 TPZVec<Fad<REAL>> &);
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...
static int bilinearounao[3]
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.
clarg::argInt dimension("-d", "Matrices dimension M x M", 1000)
static REAL MidSideNode[3][1]
Defines enum MElementType and contains the implementation of MElementType_NNodes(...) functions.
This class implements a simple vector storage scheme for a templated class T. Utility.
REAL val(STATE &number)
Returns value of the variable.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Handles the numerical integration for one-dimensional problems. Numerical Integration.
#define LOGPZ_FATAL(A, B)
Define log for fatal errors (cout)
Abstract class defining integration rules. Numerical Integration.
int Zero() override
Makes Zero all the elements.
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.
static int vectorsideorder[3]
#define DebugStop()
Returns a message to user put a breakpoint in.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
static int nhighdimsides[3]
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
int32_t Hash(std::string str)
static int highsides[3][1]
Integration rule for one point. Numerical Integration.
MElementType
Define the element types.
int64_t Cols() const
Returns number of cols.
Defines the interface for saving and reading data. Persistency.
static REAL sidetosidetransforms[3][1][4][3]
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Contains the TPZLine class which defines the topology of a line element.
static int sidedimension[3]
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
#define PZError
Defines the output device to error messages and the DebugStop() function.
static int direcaoksioueta[3]