GetFEM  5.4.3
getfem_mesh_fem_level_set.h
Go to the documentation of this file.
1 /* -*- c++ -*- (enables emacs c++ mode) */
2 /*===========================================================================
3 
4  Copyright (C) 2004-2020 Yves Renard
5 
6  This file is a part of GetFEM
7 
8  GetFEM is free software; you can redistribute it and/or modify it
9  under the terms of the GNU Lesser General Public License as published
10  by the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version along with the GCC Runtime Library
12  Exception either version 3.1 or (at your option) any later version.
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  License and GCC Runtime Library Exception for more details.
17  You should have received a copy of the GNU Lesser General Public License
18  along with this program; if not, write to the Free Software Foundation,
19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
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_level_set.h
33  @author Yves Renard <Yves.Renard@insa-lyon.fr>,
34  @author Julien Pommier <Julien.Pommier@insa-toulouse.fr>
35  @date March 09, 2005.
36  @brief a subclass of mesh_fem which is conformal to a number of level sets.
37 */
38 
39 #ifndef GETFEM_MESH_FEM_LEVEL_SET_H__
40 #define GETFEM_MESH_FEM_LEVEL_SET_H__
41 
42 #include "getfem_mesh_level_set.h"
43 #include "getfem_mesh_fem.h"
44 #include "getfem_fem_level_set.h"
45 
46 namespace getfem {
47 
48  class mesh_fem_level_set : public mesh_fem {
49  protected :
50  const mesh_level_set &mls;
51  const mesh_fem &mf;
52  mutable std::vector<pfem> build_methods;
53  mutable bool is_adapted;
54  mutable dal::bit_vector enriched_dofs, enriched_elements;
55  mutable std::set<std::set<const mesh_level_set::zone *> > enrichments;
56  mutable std::vector< const std::set<const mesh_level_set::zone *> *> dof_enrichments;
57  size_type xfem_index;
58  void clear_build_methods();
59  void build_method_of_convex(size_type cv);
60 
61  public :
62  void update_from_context() const { is_adapted = false; }
63  void adapt();
64  void clear(); // to be modified
65  size_type get_xfem_index() const { return xfem_index; }
66 
67  const mesh_level_set &linked_mesh_level_set() const { return mls; }
68  const mesh_fem &linked_mesh_fem() const { return mf; }
69 
70  size_type memsize() const {
71  return mesh_fem::memsize(); // + ... ;
72  }
73 
74  mesh_fem_level_set(const mesh_level_set &me, const mesh_fem &mef);
75 
76  mesh_fem_level_set(const mesh_fem_level_set&) = delete;
77  mesh_fem_level_set& operator = (const mesh_fem_level_set&) = delete;
78 
79  ~mesh_fem_level_set() { clear_build_methods(); }
80  };
81 
82 
83 
84 
85 } /* end of namespace getfem. */
86 
87 #endif
88 
mesh_fem(const mesh &me, dim_type Q=1)
Build a new mesh_fem.
FEM associated with getfem::mesh_fem_level_set objects.
Define the getfem::mesh_fem class.
Keep informations about a mesh crossed by level-sets.
void clear(L &l)
clear (fill with zeros) a vector or matrix.
Definition: gmm_blas.h:59
size_t size_type
used as the common size type in the library
Definition: bgeot_poly.h:49
GEneric Tool for Finite Element Methods.