MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
fem_extras.hpp
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 #ifndef MFEM_FEM_EXTRAS
13 #define MFEM_FEM_EXTRAS
14 
15 #include "mfem.hpp"
16 #include <cstddef>
17 
18 namespace mfem
19 {
20 
21 namespace common
22 {
23 
24 /** The H1_FESpace class is a FiniteElementSpace which automatically
25  allocates and destroys its own FiniteElementCollection, in this
26  case an H1_FECollection object.
27 */
29 {
30 public:
31  H1_FESpace(Mesh *m,
32  const int p, const int space_dim = 3,
33  const int type = BasisType::GaussLobatto,
34  int vdim = 1, int order = Ordering::byNODES);
35  ~H1_FESpace();
36 private:
37  const FiniteElementCollection *FEC_;
38 };
39 
40 /** The ND_FESpace class is a FiniteElementSpace which automatically
41  allocates and destroys its own FiniteElementCollection, in this
42  case an ND_FECollection object.
43 */
45 {
46 public:
47  ND_FESpace(Mesh *m, const int p, const int space_dim,
48  int vdim = 1, int order = Ordering::byNODES);
49  ~ND_FESpace();
50 private:
51  const FiniteElementCollection *FEC_;
52 };
53 
54 /** The RT_FESpace class is a FiniteElementSpace which automatically
55  allocates and destroys its own FiniteElementCollection, in this
56  case an RT_FECollection object.
57 */
59 {
60 public:
61  RT_FESpace(Mesh *m, const int p, const int space_dim,
62  int vdim = 1, int order = Ordering::byNODES);
63  ~RT_FESpace();
64 private:
65  const FiniteElementCollection *FEC_;
66 };
67 
68 
69 /// Visualize the given mesh object, using a GLVis server on the
70 /// specified host and port. Set the visualization window title, and optionally,
71 /// its geometry.
72 void VisualizeMesh(socketstream &sock, const char *vishost, int visport,
73  Mesh &mesh, const char *title,
74  int x = 0, int y = 0, int w = 400, int h = 400,
75  const char *keys = NULL);
76 
77 /// Visualize the given grid function, using a GLVis server on the
78 /// specified host and port. Set the visualization window title, and optionally,
79 /// its geometry.
80 void VisualizeField(socketstream &sock, const char *vishost, int visport,
81  GridFunction &gf, const char *title,
82  int x = 0, int y = 0, int w = 400, int h = 400,
83  const char *keys = NULL, bool vec = false);
84 
85 } // namespace common
86 
87 } // namespace mfem
88 
89 #endif
RT_FESpace(Mesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
Definition: fem_extras.cpp:47
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:30
ND_FESpace(Mesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
Definition: fem_extras.cpp:35
int vdim
Vector dimension (number of unknowns per degree of freedom).
Definition: fespace.hpp:100
constexpr char vishost[]
constexpr int visport
H1_FESpace(Mesh *m, const int p, const int space_dim=3, const int type=BasisType::GaussLobatto, int vdim=1, int order=Ordering::byNODES)
Definition: fem_extras.cpp:22
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition: fespace.hpp:87
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Definition: fe_coll.hpp:26
void VisualizeMesh(socketstream &sock, const char *vishost, int visport, Mesh &mesh, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
Definition: fem_extras.cpp:59
void VisualizeField(socketstream &sock, const char *vishost, int visport, GridFunction &gf, const char *title, int x, int y, int w, int h, const char *keys, bool vec)
Definition: fem_extras.cpp:94