9 #ifndef __PZ__TPZWavyLine__ 10 #define __PZ__TPZWavyLine__ 42 TPZGeoLinear(cp,gl2lcNdMap), fNumWaves(cp.fNumWaves), fWaveDir(cp.fWaveDir)
48 TPZGeoLinear(cp), fNumWaves(cp.fNumWaves), fWaveDir(cp.fWaveDir)
54 TPZGeoLinear(cp), fNumWaves(cp.fNumWaves), fWaveDir(cp.fWaveDir)
61 if (wavedir.
size() != 3) {
75 static std::string
TypeName() {
return "Wavy";}
101 int nrow = nodes.
Rows();
102 int ncol = nodes.
Cols();
107 T cosval =
cos(fNumWaves*M_PI*loc[0]);
108 for (
int i=0; i<3; i++) {
109 gradx(i) = (nodes.
GetVal(i,1)-nodes.
GetVal(i,0))/2. + fNumWaves*M_PI*cosval*fWaveDir[i];
141 T sinval =
sin(this->fNumWaves*M_PI*loc[0]);
143 for (
int i=0; i<3; i++) {
144 result[i] += this->fWaveDir[i]*sinval;
160 buf.
Read(&fNumWaves,1);
166 buf.
Write(&fNumWaves,1);
167 buf.
Write( fWaveDir);
void Read(TPZStream &buf, void *context) override
read objects from the stream
TPZWavyLine(const TPZWavyLine &cp, TPZGeoMesh &)
Copy constructor.
void X(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZVec< T > &result) const
static std::string TypeName()
Returns the type name of the element.
void Read(TPZStream &buf, void *context) override
Creates a geometric element according to the type of the father element.
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
int ClassId() const override
Creates a geometric element according to the type of the father element.
TPZWavyLine()
Empty constructor.
TPZManVector< REAL, 3 > fWaveDir
Implements the geometry of a one dimensional linear element. Geometry.
static bool IsLinearMapping(int side)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
int Zero() override
Makes Zero all the elements.
int64_t size() const
Returns the number of elements of the vector.
virtual void Write(const bool val)
#define DebugStop()
Returns a message to user put a breakpoint in.
void SetData(TPZVec< REAL > &wavedir, int numwaves)
int64_t Rows() const
Returns number of rows.
TPZWavyLine(TPZVec< int64_t > &nodeindexes)
Constructor with list of nodes.
void GradX(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZFMatrix< T > &gradx) const
TPZWavyLine(const TPZWavyLine &cp, std::map< int64_t, int64_t > &gl2lcNdMap)
Constructor with node map.
This class implements a geometric mesh for the pz environment. Geometry.
static void X(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZVec< T > &x)
Compute X mapping from element nodes and local parametric coordinates.
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.
Defines the interface for saving and reading data. Persistency.
Groups all classes which model the geometry.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
TPZWavyLine(const TPZWavyLine &cp)
Copy constructor.
virtual void Read(bool &val)