Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
scalar_obstacle.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013-2015: G-CSC, Goethe University Frankfurt
3 * Author: Raphael Prohl
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_ALGEBRA__OPERATOR__PRECONDITIONER__PROJECTED_GAUSS_SEIDEL__SCALAR_LOWER_OBSTACLE__
34#define __H__UG__LIB_ALGEBRA__OPERATOR__PRECONDITIONER__PROJECTED_GAUSS_SEIDEL__SCALAR_LOWER_OBSTACLE__
35
38
39using namespace std;
40
41namespace ug{
42
44
59template <typename TDomain, typename TAlgebra>
61 public IObstacleConstraint<TDomain,TAlgebra>
62{
63 public:
66
68 typedef TAlgebra algebra_type;
69
71 typedef typename algebra_type::matrix_type matrix_type;
72
74 typedef typename algebra_type::vector_type vector_type;
75
77 typedef typename vector_type::value_type value_type;
78
81
82 public:
85 IObstacleConstraint<TDomain,TAlgebra>(u){};
86
89 IObstacleConstraint<TDomain,TAlgebra>(){};
90
92 void adjust_sol_and_cor(value_type& sol_i, value_type& c_i, bool& dofIsActive,
93 const DoFIndex& dof);
94
96
98
101
102 private:
105
108};
109
110template <typename TDomain, typename TAlgebra>
112 public IObstacleConstraint<TDomain,TAlgebra>
113{
114 public:
117
119 typedef TAlgebra algebra_type;
120
122 typedef typename algebra_type::matrix_type matrix_type;
123
125 typedef typename algebra_type::vector_type vector_type;
126
128 typedef typename vector_type::value_type value_type;
129
132
133 public:
136 IObstacleConstraint<TDomain,TAlgebra>(u){};
137
140 IObstacleConstraint<TDomain,TAlgebra>(){};
141
143 void adjust_sol_and_cor(value_type& sol_i, value_type& c_i, bool& dofIsActive,
144 const DoFIndex& dof);
145
147
148 void restrict_obs_values();
149
152
153 private:
156
159};
160
161} // end namespace ug
162
163// include implementation
164#include "scalar_obstacle_impl.h"
165
166#endif /* __H__UG__LIB_ALGEBRA__OPERATOR__PRECONDITIONER__PROJECTED_GAUSS_SEIDEL__SCALAR_LOWER_OBSTACLE__ */
represents numerical solutions on a grid using an algebraic vector
Definition grid_function.h:121
Interface for Obstacle Constraints.
Definition obstacle_constraint_interface.h:73
map< DoFIndex, number > m_mObstacleValues
map to store obstacle values with its corresponding DoFs
Definition obstacle_constraint_interface.h:259
vector< DoFIndex > m_vActiveDofs
stores the dofs, which satisfy the constraints with equality
Definition obstacle_constraint_interface.h:265
Definition multi_index.h:50
Scalar Lower Obstacles.
Definition scalar_obstacle.h:62
vector_type::value_type value_type
Value type.
Definition scalar_obstacle.h:77
algebra_type::vector_type vector_type
Vector type.
Definition scalar_obstacle.h:74
algebra_type::matrix_type matrix_type
Matrix type.
Definition scalar_obstacle.h:71
~ScalarLowerObstacle()
Destructor.
Definition scalar_obstacle.h:100
IObstacleConstraint< TDomain, TAlgebra > base_type
Base class type.
Definition scalar_obstacle.h:65
void restrict_obs_values()
restricts the obstacle values to a coarser grid in a multigrid hierarchy
Definition scalar_obstacle_impl.h:90
ScalarLowerObstacle()
default constructor
Definition scalar_obstacle.h:88
TAlgebra algebra_type
Algebra type.
Definition scalar_obstacle.h:68
ScalarLowerObstacle(const function_type &u)
constructor for a scalar obstacle
Definition scalar_obstacle.h:84
GridFunction< TDomain, TAlgebra > function_type
Type of grid function.
Definition scalar_obstacle.h:80
void adjust_defect_to_constraint(vector_type &d)
the defect needs to be adjusted for the active indices (those indices, which are in contact)
Definition scalar_obstacle_impl.h:74
void adjust_sol_and_cor(value_type &sol_i, value_type &c_i, bool &dofIsActive, const DoFIndex &dof)
projects the i-th index of the solution onto the admissible set and adjusts the correction
Definition scalar_obstacle_impl.h:47
Definition scalar_obstacle.h:113
ScalarUpperObstacle()
default constructor
Definition scalar_obstacle.h:139
vector_type::value_type value_type
Value type.
Definition scalar_obstacle.h:128
GridFunction< TDomain, TAlgebra > function_type
Type of grid function.
Definition scalar_obstacle.h:131
ScalarUpperObstacle(const function_type &u)
constructor for a scalar obstacle
Definition scalar_obstacle.h:135
algebra_type::vector_type vector_type
Vector type.
Definition scalar_obstacle.h:125
void adjust_defect_to_constraint(vector_type &d)
the defect needs to be adjusted for the active indices (those indices, which are in contact)
Definition scalar_obstacle_impl.h:128
~ScalarUpperObstacle()
Destructor.
Definition scalar_obstacle.h:151
TAlgebra algebra_type
Algebra type.
Definition scalar_obstacle.h:119
void restrict_obs_values()
restricts the obstacle values to a coarser grid in a multigrid hierarchy
Definition scalar_obstacle_impl.h:148
void adjust_sol_and_cor(value_type &sol_i, value_type &c_i, bool &dofIsActive, const DoFIndex &dof)
projects the i-th index of the solution onto the admissible set and adjusts the correction
Definition scalar_obstacle_impl.h:100
algebra_type::matrix_type matrix_type
Matrix type.
Definition scalar_obstacle.h:122
IObstacleConstraint< TDomain, TAlgebra > base_type
Base class type.
Definition scalar_obstacle.h:116
Definition smart_pointer.h:814
the ug namespace
T value_type
Definition sparsematrix_interface.h:2