MFEM  v3.3
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, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
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 miniapps
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 grid function, using a GLVis server on the
70 /// specified host and port. Set the visualization window title, and optionally,
71 /// its geometry.
72 void VisualizeField(socketstream &sock, const char *vishost, int visport,
73  GridFunction &gf, const char *title,
74  int x = 0, int y = 0, int w = 400, int h = 400,
75  bool vec = false);
76 
77 } // namespace miniapps
78 
79 } // namespace mfem
80 
81 #endif
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
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:27
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:69
void VisualizeField(socketstream &sock, const char *vishost, int visport, GridFunction &gf, const char *title, int x, int y, int w, int h, bool vec)
Definition: fem_extras.cpp:59