30 #include "PlaneElement.h" 35 #include "preprocessor/multi_block_topology/matrices/ElemPtrArray3d.h" 36 #include "preprocessor/multi_block_topology/aux_meshing.h" 37 #include "preprocessor/prep_handlers/LoadHandler.h" 38 #include "domain/load/plane/BidimStrainLoad.h" 39 #include "vtkCellType.h" 44 template <
class PhysProp>
47 static Matrix &compute_extrapolation_matrix(
void);
52 QuadBase4N(
int tag,
int classTag,
const PhysProp &);
53 QuadBase4N(
int tag,
int classTag,
int node1,
int node2,
int node3,
int node4,
const PhysProp &pp);
61 void setRho(
const double &);
76 template <
class PhysProp>
81 template <
class PhysProp>
86 template <
class PhysProp>
90 this->theNodes.set_id_nodes(node1,node2,node3,node4);
96 template <
class PhysProp>
104 template <
class PhysProp>
109 template <
class PhysProp>
114 const size_t sz= nodes.size();
119 retval[1]= nodes(i+1);
128 template <
class PhysProp>
133 const int i1= nodes.
find(n1);
134 const int i2= nodes.
find(n2);
135 if((i1>=0) && (i2>=0))
137 const int dif= i2-i1;
142 else if((i1==3) && (i2==0))
144 else if((i1==0) && (i2==3))
151 template <
class PhysProp>
156 const size_t sz= nodes.size();
169 template <
class PhysProp>
171 {
return this->physicalProperties.getArealRho(); }
174 template <
class PhysProp>
176 { this->physicalProperties.setArealRho(r); }
179 template <
class PhysProp>
181 {
return this->physicalProperties.getThickness(); }
184 template <
class PhysProp>
186 { this->physicalProperties.setThickness(t); }
189 template <
class PhysProp>
193 this->physicalProperties.getMaterialsVector().zeroInitialGeneralizedStrains();
198 template <
class PhysProp>
202 std::cerr << this->getClassName()
203 <<
"; load over inactive element: " 204 << this->getTag() << std::endl;
207 if(
const BidimStrainLoad *strainLoad= dynamic_cast<const BidimStrainLoad *>(theLoad))
209 static std::vector<Vector> initStrains;
210 initStrains= strainLoad->getStrains();
211 for(std::vector<Vector>::iterator i= initStrains.begin();i!=initStrains.end();i++)
213 this->physicalProperties.getMaterialsVector().incrementInitialGeneralizedStrains(initStrains);
217 std::cerr << this->getClassName() <<
"::" << __FUNCTION__
218 <<
"; load type unknown for element with tag: " <<
219 this->getTag() << std::endl;
227 template <
class PhysProp>
233 template <
class PhysProp>
243 const Vector &coor0= theNodes[0]->getCrds();
244 const Vector &coor1= theNodes[1]->getCrds();
245 const Vector &coor2= theNodes[2]->getCrds();
246 const Vector &coor3= theNodes[3]->getCrds();
258 double length= v1.
Norm( );
272 const double alpha= v2^v1;
288 R(0,0)= v1(0); R(0,1)= v1(1);
289 R(1,0)= v2(0); R(1,1)= v2(1);
295 template <
class PhysProp>
299 std::cerr << this->getClassName() <<
"::" << __FUNCTION__
300 <<
"; for deformed geometry not implemented." 302 return getTrfMatrix();
308 template <
class PhysProp>
311 const double r3div2= sqrt(3)/2.0;
312 const double dg= 1.0+r3div2;
313 const double m= 1.0-r3div2;
314 static Matrix retval(4,4);
316 retval(0,0)= dg; retval(0,1)= -0.5; retval(0,2)= m; retval(0,3)= -0.5;
317 retval(1,0)= -0.5; retval(1,1)= dg; retval(1,2)= -0.5; retval(1,3)= m;
318 retval(2,0)= m; retval(2,1)= -0.5; retval(2,2)= dg; retval(2,3)= -0.5; retval(3,0)= -0.5; retval(3,1)= m; retval(3,2)= -0.5; retval(3,3)= dg;
325 template <
class PhysProp>
328 static const Matrix retval= compute_extrapolation_matrix();
ElemPtrArray3d put_on_mesh(const NodePtrArray3d &, meshing_dir dm) const
Put the element on the mesh being passed as parameter.
Definition: QuadBase4N.h:105
std::vector< const Node * > NodesEdge
Nodes on an element edge.
Definition: Element.h:116
Float vector abstraction.
Definition: Vector.h:94
Base class for grids of bool in 3D (used to express if something exists or not in a (layer...
Definition: BoolArray3d.h:34
double getThickness(void) const
Return material density.
Definition: QuadBase4N.h:180
QuadBase4N(int classTag, const PhysProp &)
Constructor.
Definition: QuadBase4N.h:77
double Norm(void) const
Return the norm of vector.
Definition: Vector.cpp:780
Vector of integers.
Definition: ID.h:95
void Zero(void)
Zeros out the Vector, i.e.
Definition: Vector.h:263
BoolArray3d getNodePattern(void) const
Return a grid of booleans, one for each of the element nodes.
Definition: QuadBase4N.h:97
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:47
iterator find(const int &)
Returns an iterator to the node identified by the tag being passed as parameter.
Definition: NodePtrs.cc:151
const Matrix & getExtrapolationMatrix(void) const
Return the matrix that can be used to extrapolate the results from the Gauss points to the element no...
Definition: QuadBase4N.h:326
Base class for 4 node quads.
Definition: QuadBase4N.h:45
int getVtkCellType(void) const
Interfaz con VTK.
Definition: QuadBase4N.h:228
ID getLocalIndexNodesEdge(const size_t &i) const
Returns the local indexes of the nodes that lie on the i-th edge.
Definition: QuadBase4N.h:152
void setThickness(const double &)
Return material density.
Definition: QuadBase4N.h:185
double getRho(void) const
Return material density (mass per surface unit).
Definition: QuadBase4N.h:170
void setRho(const double &)
Return material density.
Definition: QuadBase4N.h:175
Matrix getTrfMatrix(void) const
Returns a matrix with the axes of the element as matrix rows [[x1,y1,z1],[x2,y2,z2],...·].
Definition: QuadBase4N.h:234
Element::NodesEdge getNodesEdge(const size_t &i) const
Returns the nodes de un lado of the element.
Definition: QuadBase4N.h:110
Node pointer container for elements.
Definition: NodePtrsWithIDs.h:46
int addLoad(ElementalLoad *theLoad, double loadFactor)
Adds to the element the load being passed as parameter.
Definition: QuadBase4N.h:199
Three-dimensional array of pointers to nodes.
Definition: NodePtrArray3d.h:51
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
Base class for loads over elements.
Definition: ElementalLoad.h:79
Load due to restricted material expansion or contraction on bidimensional elements.
Definition: BidimStrainLoad.h:39
Mesh node.
Definition: Node.h:111
Base class for plane elements.
Definition: PlaneElement.h:55
void zeroLoad(void)
Zeroes loads on element.
Definition: QuadBase4N.h:190
int getEdgeNodes(const Node *, const Node *) const
Returns the edge of the element that ends in the nodes being passed as parameters.
Definition: QuadBase4N.h:129
ElemPtrArray3d put_quad4N_on_mesh(const Element &e, const NodePtrArray3d &, meshing_dir dm)
Place the elements on the mesh passed as parameter.
Definition: aux_meshing.cc:136
Matrix getLocalAxes(bool initialGeometry=true) const
Returns a matrix with the axes of the element as matrix rows [[x1,y1,z1],[x2,y2,z2],...·].
Definition: QuadBase4N.h:296