MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
wedge.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, 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 // Implementation of class Wedge
13 
14 #include "mesh_headers.hpp"
15 
16 namespace mfem
17 {
18 
19 Wedge::Wedge(const int *ind, int attr)
20  : Element(Geometry::PRISM)
21 {
22  attribute = attr;
23  for (int i = 0; i < 6; i++)
24  {
25  indices[i] = ind[i];
26  }
27 }
28 
29 Wedge::Wedge(int ind1, int ind2, int ind3, int ind4, int ind5, int ind6,
30  int attr)
31  : Element(Geometry::PRISM)
32 {
33  attribute = attr;
34  indices[0] = ind1;
35  indices[1] = ind2;
36  indices[2] = ind3;
37  indices[3] = ind4;
38  indices[4] = ind5;
39  indices[5] = ind6;
40 }
41 
42 void Wedge::SetVertices(const int *ind)
43 {
44  for (int i = 0; i < 6; i++)
45  {
46  indices[i] = ind[i];
47  }
48 }
49 
51 {
52  v.SetSize(6);
53  for (int i = 0; i < 6; i++)
54  {
55  v[i] = indices[i];
56  }
57 }
58 
59 int Wedge::GetNFaces(int &nFaceVertices) const
60 {
61  MFEM_ABORT("this method is not valid for Wedge elements");
62  nFaceVertices = 4;
63  return 5;
64 }
65 
66 }
virtual void SetVertices(const int *ind)
Set the vertices according to the given input.
Definition: wedge.cpp:42
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:654
virtual int GetNFaces() const
Definition: wedge.hpp:60
int indices[6]
Definition: wedge.hpp:25
virtual int * GetVertices()
Definition: wedge.hpp:48
Abstract data type element.
Definition: element.hpp:28