/* $Id: elementsA.h,v 1.3 1996/10/31 15:23:17 bzferdma Exp $ */ #ifndef ELEMENTSA_H #define ELEMENTSA_H #include "elements.h" #include "array3.h" class IntegForm; class Material; //------------------------------------------------------------------------- class StdElement : public Element { protected: Material* material; StdElement* edgeElement; StdElement* faceElement; // shape functions etc. for numerical integration: // ... for stiffness matrix: Matrix* N; // shape functions N(intPoint,Node) Array3* dNU; // derivatives on basic (unit) element IntegForm * IF; // numer. integ. form. for stiffness matrix // ... for mass matrix: Matrix* NMass; IntegForm * IFMass; IntegForm * IFLumpedMass; // constant matrices and vectors for unit element (c.f. Schwarz): Matrix* M; // constant mass matrix //Matrix* P; // constant mass matrix in parabolic equation Vector* B; // constant source term Matrix *S1, *S2, *S3, *S4, *S5, *S6; // partial stiffness matrices Matrix *C1, *C2, *C3; // partial convection matrices // Temporaries used in several routines Vector *tmp_nodes; Matrix *tmp_Ell; Matrix *tmp_dN; Vector *tmp_u; Vector *tmp_x; Vector *tmp_xBnd; Vector *tmp_matE; virtual int NoOfBaseNodes() const { return NoOfNodes(); } virtual void basicInit() = 0; virtual void setShapeFunctionsAtIPs(int nComp=1); virtual void compConstantMatrices() = 0; void transformDerivDN(Matrix& dN, int ip, const Jacobian& Jac) const; // unit element -> Real elem. void checkUnitCoord(const Vector& unitCoord) const; virtual void InfoIntegFormulas(const char* elementName) const; virtual void getLocalFaceNodes(int k, Vector& nodes) const; public: StdElement(); virtual ~StdElement(); virtual Num valueAt(const Vector& unitCoord, const Vector& sol) const; virtual void valueAt(const Vector& unitCoord, const Vector& sol, Vector& uInt, int baseNode, int nComp) const; virtual void gradientAt(int ip, const Jacobian& Jac, const Vector& sol, Vector& grad) const; virtual Bool assembleEllip(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual void assembleConstEllip(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleMass(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleLumpedMass(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleP(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleLumpedP(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleConvec (const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual void assembleConstConvec (const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleSource (const PATCH& patch, Vector& b, const Jacobian& Jac, const Matrix* pattern, Real time=0.0) const; virtual Bool assembleNeumannBCs(const PATCH& patch, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual Bool assembleInnerBCs (const PATCH& patch, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual Bool assembleCauchyBCs (const PATCH& patch, Matrix& A, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual Bool assNeumannBCOnBoundary(const PATCH& ed, Vector& nodes, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual Bool assBConInnerBoundary(const PATCH& ed, Vector& nodes, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual void assCauchyBCOnBoundary(const PATCH& ed, Vector& nodes, Matrix& A, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual void assembleL2Norm(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual void assembleLNorm (const PATCH& patch, Vector& b, const Jacobian& Jac, const Matrix* pattern) const; //------------------------------------------------------------------------- //------------------------------------------------------------------------- // -- special 1D - routines: virtual void assembleConstEllip1(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual void assembleConstConvec1(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual Bool assembleNeumannBCs1(const PATCH& patch, Vector& b, const Matrix* pattern, Real time=0.0) const; virtual Bool assembleCauchyBCs1(const PATCH& patch, Matrix& A, Vector& b, const Matrix* pattern, Real time=0.0) const; //------------------------------------------------------------------------- // -- special 2D - routines: virtual void assembleConstEllip2(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual void assembleConstConvec2(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; //------------------------------------------------------------------------- // -- special 3D - routines: virtual void assembleConstEllip3(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; virtual void assembleConstConvec3(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern) const; //------------------------------------------------------------------------- //------------------------------------------------------------------------- //------------------------------------------------------------------------- // -- specimen for multi-component elements: virtual Bool MCEllip(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual Bool MCConvec (const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual Bool MCSource(const PATCH& patch, Vector& b, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node, Real time) const; virtual Bool MCMass(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual Bool MCLumpedMass(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual Bool MCNeumannBCs(const PATCH& patch, Vector& b, const Matrix* pattern, int nComp, const Matrix& Node, Real time) const; virtual Bool MCCauchyBCs (const PATCH& patch, Matrix& A, Vector& b, const Matrix* pattern, int nComp, const Matrix& Node, Real time) const; virtual void MCL2Norm(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual void MCLNorm (const PATCH& patch, Vector& b, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; protected: virtual Bool MCNeumannBCOnBoundary(const PATCH& ed, Vector& nodes, Vector& b, const Matrix* pattern, int comp, const Matrix& Node, Real time) const; virtual void MCCauchyBCOnBoundary(const PATCH& ed, Vector& nodes, Matrix& A, Vector& b, const Matrix* pattern, int comp, const Matrix& Node, Real time) const; public: //------------------------------------------------------------------------- //------------------------------------------------------------------------- // -- special 1D - routines: virtual void MCConstEllip1(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual void MCConstConvec1(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual Bool MCNeumannBCs1(const PATCH& patch, Vector& b, const Matrix* pattern, int nComp, const Matrix& Node, Real time=0.0) const; virtual Bool MCCauchyBCs1(const PATCH& patch, Matrix& A, Vector& b, const Matrix* pattern, int nComp, const Matrix& Node, Real time=0.0) const; //------------------------------------------------------------------------- // -- special 2D - routines: virtual void MCConstEllip2(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual void MCConstConvec2(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; //------------------------------------------------------------------------- // -- special 3D - routines: virtual void MCConstEllip3(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; virtual void MCConstConvec3(const PATCH& patch, Matrix& A, const Jacobian& Jac, const Matrix* pattern, int nComp, const Matrix& Node) const; }; #endif