MFEM
v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
mesh
element.cpp
Go to the documentation of this file.
1
// Copyright (c) 2010-2025, 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
#include "
mesh_headers.hpp
"
13
14
namespace
mfem
15
{
16
17
Element::Type
Element::TypeFromGeometry
(
const
Geometry::Type
geom)
18
{
19
switch
(geom)
20
{
21
case
Geometry::POINT
:
return
Element::POINT
;
22
case
Geometry::SEGMENT
:
return
Element::SEGMENT
;
23
case
Geometry::TRIANGLE
:
return
Element::TRIANGLE
;
24
case
Geometry::SQUARE
:
return
Element::QUADRILATERAL
;
25
case
Geometry::TETRAHEDRON
:
return
Element::TETRAHEDRON
;
26
case
Geometry::CUBE
:
return
Element::HEXAHEDRON
;
27
case
Geometry::PRISM
:
return
Element::WEDGE
;
28
case
Geometry::PYRAMID
:
return
Element::PYRAMID
;
29
default
: MFEM_ABORT(
"Unknown geometry type."
);
30
}
31
}
32
33
void
Element::SetVertices
(
const
int
*ind)
34
{
35
int
i, n, *v;
36
37
n =
GetNVertices
();
38
v =
GetVertices
();
39
40
for
(i = 0; i < n; i++)
41
{
42
v[i] = ind[i];
43
}
44
}
45
46
}
mfem::Element::GetVertices
virtual int * GetVertices()=0
mfem::Element::Type
Type
Constants for the classes derived from Element.
Definition
element.hpp:41
mfem::Element::TETRAHEDRON
@ TETRAHEDRON
Definition
element.hpp:42
mfem::Element::QUADRILATERAL
@ QUADRILATERAL
Definition
element.hpp:41
mfem::Element::SEGMENT
@ SEGMENT
Definition
element.hpp:41
mfem::Element::HEXAHEDRON
@ HEXAHEDRON
Definition
element.hpp:42
mfem::Element::POINT
@ POINT
Definition
element.hpp:41
mfem::Element::PYRAMID
@ PYRAMID
Definition
element.hpp:42
mfem::Element::WEDGE
@ WEDGE
Definition
element.hpp:42
mfem::Element::TRIANGLE
@ TRIANGLE
Definition
element.hpp:41
mfem::Element::TypeFromGeometry
static Type TypeFromGeometry(const Geometry::Type geom)
Return the Element::Type associated with the given Geometry::Type.
Definition
element.cpp:17
mfem::Element::GetNVertices
virtual int GetNVertices() const =0
mfem::Element::SetVertices
virtual void SetVertices(const Array< int > &v)=0
Set the indices defining the vertices.
mfem::Geometry::Type
Type
Definition
geom.hpp:40
mfem::Geometry::TETRAHEDRON
@ TETRAHEDRON
Definition
geom.hpp:42
mfem::Geometry::POINT
@ POINT
Definition
geom.hpp:42
mfem::Geometry::SEGMENT
@ SEGMENT
Definition
geom.hpp:42
mfem::Geometry::TRIANGLE
@ TRIANGLE
Definition
geom.hpp:42
mfem::Geometry::SQUARE
@ SQUARE
Definition
geom.hpp:42
mfem::Geometry::CUBE
@ CUBE
Definition
geom.hpp:42
mfem::Geometry::PRISM
@ PRISM
Definition
geom.hpp:42
mfem::Geometry::PYRAMID
@ PYRAMID
Definition
geom.hpp:42
mesh_headers.hpp
mfem
Definition
CodeDocumentation.dox:1
Generated on Wed Apr 9 2025 16:53:05 for MFEM by
1.11.0