ug4
neumann_boundary_base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2015: G-CSC, Goethe University Frankfurt
3  * Author: Andreas Vogel
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__NEUMANN_BOUNDARY___NEUMANN_BOUNDARY_BASE__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__NEUMANN_BOUNDARY___NEUMANN_BOUNDARY_BASE__
35 
36 // other ug4 modules
37 #include "common/common.h"
38 
39 // library intern headers
41 
42 namespace ug{
43 
44 template<typename TDomain>
46  : public IElemDisc<TDomain>
47 {
48  private:
51 
54 
55  public:
57  static const int dim = base_type::dim;
58 
59  public:
61  NeumannBoundaryBase(const char* function);
62 
65  virtual void add(SmartPtr<CplUserData<number, dim> > data, const char* BndSubsets, const char* InnerSubsets) = 0;
66  void add(SmartPtr<CplUserData<number, dim> > data, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
67  virtual void add(SmartPtr<CplUserData<number, dim, bool> > user, const char* BndSubsets, const char* InnerSubsets) = 0;
68  void add(SmartPtr<CplUserData<number, dim, bool> > user, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
69  virtual void add(SmartPtr<CplUserData<MathVector<dim>, dim> > user, const char* BndSubsets, const char* InnerSubsets) = 0;
70  void add(SmartPtr<CplUserData<MathVector<dim>, dim> > user, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
71 
72  void add(number val, const char* BndSubsets, const char* InnerSubsets);
73  void add(number val, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
74  void add(const std::vector<number>& val, const char* BndSubsets, const char* InnerSubsets);
75  void add(const std::vector<number>& val, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
76 #ifdef UG_FOR_LUA
77  void add(const char* name, const char* BndSubsets, const char* InnerSubsets);
78  void add(const char* name, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
79  void add(LuaFunctionHandle fct, const char* BndSubsets, const char* InnerSubsets);
80  void add(LuaFunctionHandle fct, const std::vector<std::string>& BndSubsets, const std::vector<std::string>& InnerSubsets);
81 #endif
83 
84  protected:
86  struct Data
87  {
88  Data(std::string BndSubsets_, std::string InnerSubsets_)
89  : BndSubsetNames(BndSubsets_), InnerSubsetNames(InnerSubsets_) {}
91  std::string BndSubsetNames;
93  std::string InnerSubsetNames;
94  };
95 
97  void update_subset_groups(Data& userData);
98 
100  void add_inner_subsets(const char* InnerSubsets);
101 
102  public:
104  virtual int type() const {return EDT_BND;}
105 
106  protected:
109  template<typename TElem, typename TFVGeom>
110  void add_jac_A_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
111  template<typename TElem, typename TFVGeom>
112  void add_jac_M_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
113  template<typename TElem, typename TFVGeom>
114  void add_def_A_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
115  template<typename TElem, typename TFVGeom>
116  void add_def_M_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
118 };
119 
120 } // end namespac ug
121 
122 #endif /*__H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__NEUMANN_BOUNDARY___NEUMANN_BOUNDARY_BASE__*/
location name
Definition: checkpoint_util.lua:128
Definition: smart_pointer.h:108
Type based UserData.
Definition: user_data.h:501
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
Definition: elem_disc_interface.h:800
static const int dim
Definition: elem_disc_interface.h:803
Definition: local_algebra.h:422
Definition: local_algebra.h:198
Handle for a lua reference.
Definition: lua_function_handle.h:40
Definition: neumann_boundary_base.h:47
virtual void add(SmartPtr< CplUserData< MathVector< dim >, dim > > user, const char *BndSubsets, const char *InnerSubsets)=0
NeumannBoundaryBase< TDomain > this_type
Base class type.
Definition: neumann_boundary_base.h:53
void add_jac_A_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: neumann_boundary_base.h:110
virtual void add(SmartPtr< CplUserData< number, dim > > data, const char *BndSubsets, const char *InnerSubsets)=0
virtual void add(SmartPtr< CplUserData< number, dim, bool > > user, const char *BndSubsets, const char *InnerSubsets)=0
static const int dim
World dimension.
Definition: neumann_boundary_base.h:57
void add_def_A_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: neumann_boundary_base.h:114
void add_def_M_elem(LocalVector &d, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: neumann_boundary_base.h:116
virtual int type() const
returns the type of elem disc
Definition: neumann_boundary_base.h:104
IElemDisc< TDomain > base_type
Base class type.
Definition: neumann_boundary_base.h:50
void update_subset_groups(Data &userData)
method used to extract subsets id
Definition: neumann_boundary_base.cpp:60
void add_inner_subsets(const char *InnerSubsets)
adds subsets to the looped inner subsets
Definition: neumann_boundary_base.cpp:80
NeumannBoundaryBase(const char *function)
default constructor
Definition: neumann_boundary_base.cpp:47
void add_jac_M_elem(LocalMatrix &J, const LocalVector &u, GridObject *elem, const MathVector< dim > vCornerCoords[])
Definition: neumann_boundary_base.h:112
Group of subsets.
Definition: subset_group.h:51
double number
Definition: types.h:124
the ug namespace
@ EDT_BND
Definition: elem_disc_interface.h:63
base class for user data
Definition: neumann_boundary_base.h:87
SubsetGroup InnerSSGrp
Definition: neumann_boundary_base.h:92
std::string InnerSubsetNames
Definition: neumann_boundary_base.h:93
SubsetGroup BndSSGrp
Definition: neumann_boundary_base.h:90
std::string BndSubsetNames
Definition: neumann_boundary_base.h:91
Data(std::string BndSubsets_, std::string InnerSubsets_)
Definition: neumann_boundary_base.h:88