MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
fem_extras.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_FEM_EXTRAS
13#define MFEM_FEM_EXTRAS
14
15#include "mfem.hpp"
16#include <cstddef>
17
18namespace mfem
19{
20
21namespace 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{
30public:
32 const int p, const int space_dim = 3,
33 const int type = BasisType::GaussLobatto,
34 int vdim = 1, int order = Ordering::byNODES);
36private:
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{
46public:
47 ND_FESpace(Mesh *m, const int p, const int space_dim,
48 int vdim = 1, int order = Ordering::byNODES);
50private:
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{
60public:
61 RT_FESpace(Mesh *m, const int p, const int space_dim,
62 int vdim = 1, int order = Ordering::byNODES);
64private:
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.
72void 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.
80void 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
@ GaussLobatto
Closed type.
Definition fe_base.hpp:32
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Definition fe_coll.hpp:27
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:220
int vdim
Vector dimension (number of unknowns per degree of freedom).
Definition fespace.hpp:234
Class for grid function - Vector with associated FE space.
Definition gridfunc.hpp:31
Mesh data type.
Definition mesh.hpp:56
H1_FESpace(Mesh *m, const int p, const int space_dim=3, const int type=BasisType::GaussLobatto, int vdim=1, int order=Ordering::byNODES)
ND_FESpace(Mesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
RT_FESpace(Mesh *m, const int p, const int space_dim, int vdim=1, int order=Ordering::byNODES)
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)
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)
const int visport
const char vishost[]
real_t p(const Vector &x, real_t t)