void TPZMatRed<TVar,TSideMatrix>::SetF(const TPZFMatrix<TVar> & F) { int64_t FCols=F.Cols(),c,r,r1; fF0.Redim(fDim0,FCols); fF1.Redim(fDim1,FCols); for(c=0; c<FCols; c++){ r1=0; for(r=0; r<fDim0; r++){ fF0.PutVal( r,c,F.GetVal(r,c) ) ; } //aqui r=fDim0 for( ;r<fDim0+fDim1; r++){ fF1.PutVal( r1++,c,F.GetVal(r,c) ); } } #ifdef LOG4CXX if (logger->isDebugEnabled()) { std::stringstream sout; F.Print("F Input",sout); fF0.Print("fF0 Initialized",sout); fF1.Print("fF1 Initialized",sout); LOGPZ_DEBUG(logger, sout.str()) }
inline void TPZQuadraticQuad::GradX(const TPZFMatrix<REAL> &nodes,TPZVec<T> &loc, TPZFMatrix<T> &gradx){ gradx.Resize(3,2); gradx.Zero(); int nrow = nodes.Rows(); int ncol = nodes.Cols(); #ifdef PZDEBUG if(nrow != 3 || ncol != 8){ std::cout << "Objects of incompatible lengths, gradient cannot be computed." << std::endl; std::cout << "nodes matrix must be 3x8." << std::endl; DebugStop(); } #endif TPZFNMatrix<3,T> phi(NNodes,1); TPZFNMatrix<6,T> dphi(2,NNodes); TShape(loc,phi,dphi); for(int i = 0; i < NNodes; i++) { for(int j = 0; j < 3; j++) { gradx(j,0) += nodes.GetVal(j,i)*dphi(0,i); gradx(j,1) += nodes.GetVal(j,i)*dphi(1,i); } } }
void TPZQuadraticQuad::X(const TPZFMatrix<REAL> &nodes,TPZVec<T> &loc,TPZVec<T> &x){ TPZFNMatrix<4,T> phi(NNodes,1); TPZFNMatrix<8,T> dphi(2,NNodes); TShape(loc,phi,dphi); int space = nodes.Rows(); for(int i = 0; i < space; i++) { x[i] = 0.0; for(int j = 0; j < NNodes; j++) { x[i] += phi(j,0)*nodes.GetVal(i,j); } } }