MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
wedge.cpp
Go to the documentation of this file.
1// Copyright (c) 2010-2024, 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
16namespace mfem
17{
18
19Wedge::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
29Wedge::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
42void 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 std::copy(indices, indices + 6, v.begin());
54}
55
57{
58 MFEM_ASSERT(v.Size() == 6, "!");
59 std::copy(v.begin(), v.end(), indices);
60}
61
62int Wedge::GetNFaces(int &nFaceVertices) const
63{
64 MFEM_ABORT("this method is not valid for Wedge elements");
65 nFaceVertices = 4;
66 return 5;
67}
68
69}
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Definition array.hpp:697
int Size() const
Return the logical size of the array.
Definition array.hpp:144
T * end()
STL-like end. Returns pointer after the last element of the array.
Definition array.hpp:305
T * begin()
STL-like begin. Returns pointer to the first element of the array.
Definition array.hpp:302
Abstract data type element.
Definition element.hpp:29
int attribute
Element's attribute (specifying material property, etc).
Definition element.hpp:33
int indices[6]
Definition wedge.hpp:25
int GetNFaces() const override
Definition wedge.hpp:64
int * GetVertices() override
Definition wedge.hpp:49
void SetVertices(const Array< int > &v) override
Set the indices defining the vertices.
Definition wedge.cpp:56