MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
quadrilateral.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 
13 #include "mesh_headers.hpp"
14 
15 namespace mfem
16 {
17 
18 Quadrilateral::Quadrilateral( const int *ind, int attr )
19  : Element(Geometry::SQUARE)
20 {
21  attribute = attr;
22  for (int i=0; i<4; i++)
23  {
24  indices[i] = ind[i];
25  }
26 }
27 
28 Quadrilateral::Quadrilateral( int ind1, int ind2, int ind3, int ind4,
29  int attr ) : Element(Geometry::SQUARE)
30 {
31  attribute = attr;
32  indices[0] = ind1;
33  indices[1] = ind2;
34  indices[2] = ind3;
35  indices[3] = ind4;
36 }
37 
38 void Quadrilateral::SetVertices(const int *ind)
39 {
40  for (int i=0; i<4; i++)
41  {
42  indices[i] = ind[i];
43  }
44 }
45 
47 {
48  v.SetSize( 4 );
49  for (int i=0; i<4; i++)
50  {
51  v[i] = indices[i];
52  }
53 }
54 
56 
57 }
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
int attribute
Element&#39;s attribute (specifying material property, etc).
Definition: element.hpp:33
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Definition: array.hpp:679
A 2D bi-linear element on a square with nodes at the vertices of the square.
virtual int * GetVertices()
BiLinear2DFiniteElement QuadrilateralFE
Abstract data type element.
Definition: element.hpp:28