MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
point.hpp
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#ifndef MFEM_POINT
13#define MFEM_POINT
14
15#include "../config/config.hpp"
16#include "element.hpp"
17
18namespace mfem
19{
20
21/// Data type point element
22class Point : public Element
23{
24protected:
25 int indices[1];
26
27public:
29
31
32 /// Constructs point by specifying the indices and the attribute.
33 Point( const int *ind, int attr = -1 );
34
35 /// Return element's type.
36 Type GetType() const override { return Element::POINT; }
37
38 /// Get the indices defining the vertices
39 void GetVertices(Array<int> &v) const override;
40
41 /// Set the indices defining the vertices
42 void SetVertices(const Array<int> &v) override;
43
44 /// @note The returned array should NOT be deleted by the caller.
45 int * GetVertices () override { return indices; }
46
47 /// Set the vertices according to the given input.
48 void SetVertices(const int *ind) override;
49
50 int GetNVertices() const override { return 1; }
51
52 int GetNEdges() const override { return (0); }
53
54 const int *GetEdgeVertices(int ei) const override { return NULL; }
55
56 /// @deprecated Use GetNFaces(void) and GetNFaceVertices(int) instead.
57 MFEM_DEPRECATED int GetNFaces(int &nFaceVertices) const override
58 { nFaceVertices = 0; return 0; }
59
60 int GetNFaces() const override { return 0; }
61
62 int GetNFaceVertices(int) const override { return 0; }
63
64 const int *GetFaceVertices(int fi) const override { return NULL; }
65
66 Element *Duplicate(Mesh *m) const override
67 { return new Point (indices, attribute); }
68
69 virtual ~Point() = default;
70};
71
73extern MFEM_EXPORT PointFiniteElement PointFE;
74
75}
76
77#endif
Abstract data type element.
Definition element.hpp:29
int attribute
Element's attribute (specifying material property, etc).
Definition element.hpp:33
Type
Constants for the classes derived from Element.
Definition element.hpp:41
Mesh data type.
Definition mesh.hpp:56
A 0D point finite element.
Data type point element.
Definition point.hpp:23
int GetNVertices() const override
Definition point.hpp:50
Element * Duplicate(Mesh *m) const override
Definition point.hpp:66
int GetNFaces() const override
Definition point.hpp:60
int GetNEdges() const override
Definition point.hpp:52
int indices[1]
Definition point.hpp:25
void SetVertices(const Array< int > &v) override
Set the indices defining the vertices.
Definition point.cpp:30
int GetNFaceVertices(int) const override
Definition point.hpp:62
const int * GetEdgeVertices(int ei) const override
Definition point.hpp:54
virtual ~Point()=default
const int * GetFaceVertices(int fi) const override
Definition point.hpp:64
Geometry::Constants< Geometry::POINT > geom_t
Definition point.hpp:28
Type GetType() const override
Return element's type.
Definition point.hpp:36
MFEM_DEPRECATED int GetNFaces(int &nFaceVertices) const override
Definition point.hpp:57
int * GetVertices() override
Definition point.hpp:45
PointFiniteElement PointFE
Definition point.cpp:42