9 #ifndef __PZ__TPZQuadSphere__ 10 #define __PZ__TPZQuadSphere__ 17 template<
class GeomQuad = pzgeom::TPZGeoQuad>
38 std::map<int64_t,int64_t> & gl2lcNdMap) : GeomQuad(cp,gl2lcNdMap), fR(0.), fxc(3,0.)
54 GeomQuad::operator=(cp);
70 static std::string
TypeName() {
return "QuadSphere";}
78 PZError <<
"R must be positive!\n";
82 PZError <<
"XCenter must have 3 coordinates!\n";
94 GeomQuad::X(coord,loc,xqsi);
97 for (
int i = 0; i < 3; i++) {
98 xqsiLxc[i] = xqsi[i] - fxc[i];
99 norm += xqsiLxc[i] * xqsiLxc[i];
103 for (
int i = 0; i < 3; i++) {
104 result[i] = fxc[i] + xqsiLxc[i] * fR / norm;
117 GeomQuad::X(coord,param,xqsi);
119 for (
int i = 0; i < 3; i++) {
120 xqsiLxc[i] = xqsi[i] - fxc[i];
121 norm += xqsiLxc[i] * xqsiLxc[i];
126 GeomQuad::GradX(coord,param,dxdqsi);
129 T zero = param[0]-param[0];
133 for (
int i = 0; i < 3; i++) {
134 v(i,0) = xqsiLxc[i] *
fR;
135 gradv(i,i) = fR+zero;
136 gradphi(i,0) = - (1. / (norm*norm*norm) ) * xqsiLxc[i];
241 for (
int i = 0; i < 3; i++) {
242 for (
int j = 0; j < 3; j++) {
243 res(i,j) = vec1(i,0) * vec2(j,0);
258 GeomQuad::Read(buf,context);
264 GeomQuad::Write(buf, withclassid);
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
TPZQuadSphere(const TPZQuadSphere &cp, TPZGeoMesh &)
Copy constructor.
TPZQuadSphere()
Empty constructor.
TPZQuadSphere & operator=(const TPZQuadSphere &cp)
TPZQuadSphere(const TPZQuadSphere &cp)
Copy constructor.
TPZQuadSphere(const TPZQuadSphere &cp, std::map< int64_t, int64_t > &gl2lcNdMap)
Constructor with node map.
static bool IsLinearMapping(int side)
void X(TPZFMatrix< REAL > &coord, TPZVec< T > &loc, TPZVec< T > &result) const
void Write(TPZStream &buf, int withclassid) const override
void Read(TPZStream &buf, void *context) override
Creates a geometric element according to the type of the father element.
virtual void Write(const bool val)
#define DebugStop()
Returns a message to user put a breakpoint in.
static TPZFMatrix< T > TensorProd(TPZFMatrix< T > &vec1, TPZFMatrix< T > &vec2)
void GradX(TPZFMatrix< REAL > &coord, TPZVec< T > ¶m, TPZFMatrix< T > &gradx) const
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
static std::string TypeName()
Returns the type name of the element.
This class implements a geometric mesh for the pz environment. Geometry.
virtual void Multiply(const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
It mutiplies itself by TPZMatrix<TVar>A putting the result in res.
bool IsGeoBlendEl() const
declare geometry as blended element
Defines the topology of a quadrilateral element. Topology Sides 0 to 3 are vertices, sides 4 to 7 are lines, side 8 is the quadrilateral.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
pztopology::TPZQuadrilateral Top
Groups all classes which model the geometry.
TPZQuadSphere(TPZVec< int64_t > &nodeindexes)
Constructor with list of nodes.
void SetData(const REAL &R, const TPZVec< REAL > &xc)
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.
virtual void Read(bool &val)