GetFEM  5.5
getfem_mesh_fem_global_function.h
Go to the documentation of this file.
1 /* -*- c++ -*- (enables emacs c++ mode) */
2 /*===========================================================================
3 
4  Copyright (C) 2004-2026 Yves Renard
5  Copyright (C) 2016-2020 Konstantinos Poulios
6 
7  This file is a part of GetFEM
8 
9  GetFEM is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Lesser General Public License as published
11  by the Free Software Foundation; either version 3 of the License, or
12  (at your option) any later version along with the GCC Runtime Library
13  Exception either version 3.1 or (at your option) any later version.
14  This program is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  License and GCC Runtime Library Exception for more details.
18  You should have received a copy of the GNU Lesser General Public License
19  along with this program. If not, see https://www.gnu.org/licenses/.
20 
21  As a special exception, you may use this file as it is a part of a free
22  software library without restriction. Specifically, if other files
23  instantiate templates or use macros or inline functions from this file,
24  or you compile this file and link it with other files to produce an
25  executable, this file does not by itself cause the resulting executable
26  to be covered by the GNU Lesser General Public License. This exception
27  does not however invalidate any other reasons why the executable file
28  might be covered by the GNU Lesser General Public License.
29 
30 ===========================================================================*/
31 
32 /**@file getfem_mesh_fem_global_function.h
33  @author Yves Renard <Yves.Renard@insa-lyon.fr>, J. Pommier
34  @date March, 2005.
35  @brief Define a mesh_fem with base functions which are global functions
36  given by the user.
37 */
38 #ifndef GETFEM_MESH_FEM_GLOBAL_FUNCTION_H__
39 #define GETFEM_MESH_FEM_GLOBAL_FUNCTION_H__
40 
42 
43 namespace getfem {
44 
45  /** this is a convenience class for defining a mesh_fem with base functions
46  which are global functions (functions defined across more than one
47  convexes of a mesh) given by the user.
48  */
50  protected :
51  getfem::pfem fem_;
52  public :
53 
54  void set_functions(const std::vector<pglobal_function>& f,
55  const mesh_im &mim=dummy_mesh_im());
56  // size_type memsize() const;
57  virtual void clear();
58 
59  mesh_fem_global_function(const mesh &me, dim_type q=1)
60  : mesh_fem(me, q), fem_(0) {}
61  virtual ~mesh_fem_global_function() { clear(); }
62  };
63 
64  enum class bspline_boundary { FREE=0, PERIODIC=1, SYMMETRY=2};
65 
66  /** This function will generate bspline basis functions on NX uniform
67  elements along a line. The dimensions of the domain correspond to
68  the bounding interval of the 1d mesh linked by mf. The generated
69  bspline basis functions are then set as the basis of mf.
70  In case mim is provided, this integration method will be used
71  to determine the support of he basis functions more precisely.
72  */
74  (mesh_fem_global_function &mf, size_type NX, size_type order,
75  bspline_boundary bcX_low=bspline_boundary::FREE,
76  bspline_boundary bcX_high=bspline_boundary::FREE,
77  const mesh_im &mim=dummy_mesh_im());
78 
80  (mesh_fem_global_function &mf, size_type NX, size_type order,
81  bspline_boundary bcX_low, const mesh_im &mim=dummy_mesh_im()) {
83  (mf, NX, order, bcX_low, bcX_low, mim);
84  }
85 
86 
87  /** This function will generate bspline basis functions in an NX x NY
88  rectilinear grid. The generated basis spans the entire bounding
89  box of the 2d mesh linked by mf. The generated bspline basis
90  functions are then set as the basis of mf.
91  In case mim is provided, this integration method will be used to
92  determine the support of he basis functions more precisely.
93  */
95  (mesh_fem_global_function &mf,
96  size_type NX, size_type NY, size_type order,
97  bspline_boundary bcX_low=bspline_boundary::FREE,
98  bspline_boundary bcY_low=bspline_boundary::FREE,
99  bspline_boundary bcX_high=bspline_boundary::FREE,
100  bspline_boundary bcY_high=bspline_boundary::FREE,
101  const mesh_im &mim=dummy_mesh_im());
102 
104  (mesh_fem_global_function &mf,
105  size_type NX, size_type NY, size_type order,
106  bspline_boundary bcX_low, bspline_boundary bcY_low,
107  const mesh_im &mim=dummy_mesh_im()) {
109  (mf, NX, NY, order, bcX_low, bcY_low, bcX_low, bcY_low, mim);
110  }
111 
112 
113  /** This function will generate bspline basis functions in an
114  NX x NY x NZ rectilinear grid. The generated basis spans the
115  entire bounding box of the 3d mesh linked by mf. The generated
116  bspline basis functions are then set as the basis of mf.
117  In case mim is provided, this integration method will be used to
118  determine the support of he basis functions more precisely.
119  */
121  (mesh_fem_global_function &mf,
122  size_type NX, size_type NY, size_type NZ, size_type order,
123  bspline_boundary bcX_low=bspline_boundary::FREE,
124  bspline_boundary bcY_low=bspline_boundary::FREE,
125  bspline_boundary bcZ_low=bspline_boundary::FREE,
126  bspline_boundary bcX_high=bspline_boundary::FREE,
127  bspline_boundary bcY_high=bspline_boundary::FREE,
128  bspline_boundary bcZ_high=bspline_boundary::FREE,
129  const mesh_im &mim=dummy_mesh_im());
130 
132  (mesh_fem_global_function &mf,
133  size_type NX, size_type NY, size_type NZ, size_type order,
134  bspline_boundary bcX_low, bspline_boundary bcY_low,
135  bspline_boundary bcZ_low, const mesh_im &mim=dummy_mesh_im()) {
137  (mf, NX, NY, NZ, order, bcX_low, bcY_low, bcZ_low,
138  bcX_low, bcY_low, bcZ_low, mim);
139  }
140 
141 
142 } /* end of namespace getfem. */
143 
144 #endif
this is a convenience class for defining a mesh_fem with base functions which are global functions (f...
Describe a finite element method linked to a mesh.
Describe an integration method linked to a mesh.
Describe a mesh (collection of convexes (elements) and points).
Definition: getfem_mesh.h:98
Define mesh_fem whose base functions are global function given by the user.
std::shared_ptr< const getfem::virtual_fem > pfem
type of pointer on a fem description
Definition: getfem_fem.h:243
size_t size_type
used as the common size type in the library
Definition: bgeot_poly.h:48
GEneric Tool for Finite Element Methods.
void define_uniform_bspline_basis_functions_for_mesh_fem(mesh_fem_global_function &mf, size_type NX, size_type order, bspline_boundary bcX_low=bspline_boundary::FREE, bspline_boundary bcX_high=bspline_boundary::FREE, const mesh_im &mim=dummy_mesh_im())
This function will generate bspline basis functions on NX uniform elements along a line.
const mesh_im & dummy_mesh_im()
Dummy mesh_im for default parameter of functions.