GetFEM  5.4.3
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-2020 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, write to the Free Software Foundation,
20  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
21 
22  As a special exception, you may use this file as it is a part of a free
23  software library without restriction. Specifically, if other files
24  instantiate templates or use macros or inline functions from this file,
25  or you compile this file and link it with other files to produce an
26  executable, this file does not by itself cause the resulting executable
27  to be covered by the GNU Lesser General Public License. This exception
28  does not however invalidate any other reasons why the executable file
29  might be covered by the GNU Lesser General Public License.
30 
31 ===========================================================================*/
32 
33 /**@file getfem_mesh_fem_global_function.h
34  @author Yves Renard <[email protected]>, J. Pommier
35  @date March, 2005.
36  @brief Define a mesh_fem with base functions which are global functions
37  given by the user.
38 */
39 #ifndef GETFEM_MESH_FEM_GLOBAL_FUNCTION_H__
40 #define GETFEM_MESH_FEM_GLOBAL_FUNCTION_H__
41 
43 
44 namespace getfem {
45 
46  /** this is a convenience class for defining a mesh_fem with base functions
47  which are global functions (functions defined across more than one
48  convexes of a mesh) given by the user.
49  */
51  protected :
52  getfem::pfem fem_;
53  public :
54 
55  void set_functions(const std::vector<pglobal_function>& f,
56  const mesh_im &mim=dummy_mesh_im());
57  // size_type memsize() const;
58  virtual void clear();
59 
60  mesh_fem_global_function(const mesh &me, dim_type q=1)
61  : mesh_fem(me, q), fem_(0) {}
62  virtual ~mesh_fem_global_function() { clear(); }
63  };
64 
65  enum class bspline_boundary { FREE=0, PERIODIC=1, SYMMETRY=2};
66 
67  /** This function will generate bspline basis functions on NX uniform
68  elements along a line. The dimensions of the domain correspond to
69  the bounding interval of the 1d mesh linked by mf. The generated
70  bspline basis functions are then set as the basis of mf.
71  In case mim is provided, this integration method will be used
72  to determine the support of he basis functions more precisely.
73  */
75  (mesh_fem_global_function &mf, size_type NX, size_type order,
76  bspline_boundary bcX_low=bspline_boundary::FREE,
77  bspline_boundary bcX_high=bspline_boundary::FREE,
78  const mesh_im &mim=dummy_mesh_im());
79 
81  (mesh_fem_global_function &mf, size_type NX, size_type order,
82  bspline_boundary bcX_low, const mesh_im &mim=dummy_mesh_im()) {
84  (mf, NX, order, bcX_low, bcX_low, mim);
85  }
86 
87 
88  /** This function will generate bspline basis functions in an NX x NY
89  rectilinear grid. The generated basis spans the entire bounding
90  box of the 2d mesh linked by mf. The generated bspline basis
91  functions are then set as the basis of mf.
92  In case mim is provided, this integration method will be used to
93  determine the support of he basis functions more precisely.
94  */
96  (mesh_fem_global_function &mf,
97  size_type NX, size_type NY, size_type order,
98  bspline_boundary bcX_low=bspline_boundary::FREE,
99  bspline_boundary bcY_low=bspline_boundary::FREE,
100  bspline_boundary bcX_high=bspline_boundary::FREE,
101  bspline_boundary bcY_high=bspline_boundary::FREE,
102  const mesh_im &mim=dummy_mesh_im());
103 
105  (mesh_fem_global_function &mf,
106  size_type NX, size_type NY, size_type order,
107  bspline_boundary bcX_low, bspline_boundary bcY_low,
108  const mesh_im &mim=dummy_mesh_im()) {
110  (mf, NX, NY, order, bcX_low, bcY_low, bcX_low, bcY_low, mim);
111  }
112 
113 
114  /** This function will generate bspline basis functions in an
115  NX x NY x NZ rectilinear grid. The generated basis spans the
116  entire bounding box of the 3d mesh linked by mf. The generated
117  bspline basis functions are then set as the basis of mf.
118  In case mim is provided, this integration method will be used to
119  determine the support of he basis functions more precisely.
120  */
122  (mesh_fem_global_function &mf,
123  size_type NX, size_type NY, size_type NZ, size_type order,
124  bspline_boundary bcX_low=bspline_boundary::FREE,
125  bspline_boundary bcY_low=bspline_boundary::FREE,
126  bspline_boundary bcZ_low=bspline_boundary::FREE,
127  bspline_boundary bcX_high=bspline_boundary::FREE,
128  bspline_boundary bcY_high=bspline_boundary::FREE,
129  bspline_boundary bcZ_high=bspline_boundary::FREE,
130  const mesh_im &mim=dummy_mesh_im());
131 
133  (mesh_fem_global_function &mf,
134  size_type NX, size_type NY, size_type NZ, size_type order,
135  bspline_boundary bcX_low, bspline_boundary bcY_low,
136  bspline_boundary bcZ_low, const mesh_im &mim=dummy_mesh_im()) {
138  (mf, NX, NY, NZ, order, bcX_low, bcY_low, bcZ_low,
139  bcX_low, bcY_low, bcZ_low, mim);
140  }
141 
142 
143 } /* end of namespace getfem. */
144 
145 #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:99
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:244
size_t size_type
used as the common size type in the library
Definition: bgeot_poly.h:49
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.