Line data Source code
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
40 : #include "lib_disc/spatial_disc/elem_disc/elem_disc_interface.h"
41 :
42 : namespace ug{
43 :
44 : template<typename TDomain>
45 0 : class NeumannBoundaryBase
46 : : public IElemDisc<TDomain>
47 : {
48 : private:
49 : /// Base class type
50 : typedef IElemDisc<TDomain> base_type;
51 :
52 : /// Base class type
53 : typedef NeumannBoundaryBase<TDomain> this_type;
54 :
55 : public:
56 : /// World dimension
57 : static const int dim = base_type::dim;
58 :
59 : public:
60 : /// default constructor
61 : NeumannBoundaryBase(const char* function);
62 :
63 : /// add a boundary value
64 : /// \{
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
82 : /// \}
83 :
84 : protected:
85 : /// base class for user data
86 : struct Data
87 : {
88 0 : Data(std::string BndSubsets_, std::string InnerSubsets_)
89 0 : : BndSubsetNames(BndSubsets_), InnerSubsetNames(InnerSubsets_) {}
90 : SubsetGroup BndSSGrp;
91 : std::string BndSubsetNames;
92 : SubsetGroup InnerSSGrp;
93 : std::string InnerSubsetNames;
94 : };
95 :
96 : /// method used to extract subsets id
97 : void update_subset_groups(Data& userData);
98 :
99 : /// adds subsets to the looped inner subsets
100 : void add_inner_subsets(const char* InnerSubsets);
101 :
102 : public:
103 : /// returns the type of elem disc
104 0 : virtual int type() const {return EDT_BND;}
105 :
106 : protected:
107 : /// dummy add methods
108 : /// \{
109 : template<typename TElem, typename TFVGeom>
110 0 : void add_jac_A_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
111 : template<typename TElem, typename TFVGeom>
112 0 : void add_jac_M_elem(LocalMatrix& J, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
113 : template<typename TElem, typename TFVGeom>
114 0 : void add_def_A_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
115 : template<typename TElem, typename TFVGeom>
116 0 : void add_def_M_elem(LocalVector& d, const LocalVector& u, GridObject* elem, const MathVector<dim> vCornerCoords[]) {}
117 : /// \}
118 : };
119 :
120 : } // end namespac ug
121 :
122 : #endif /*__H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__NEUMANN_BOUNDARY___NEUMANN_BOUNDARY_BASE__*/
|