Flow123d  DF_patch_fevalues-e45dfbd
eval_subset.cc
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file eval_subset.cc
15  * @brief
16  * @author David Flanderka
17  */
18 
19 #include "fields/eval_subset.hh"
20 #include "fields/eval_points.hh"
22 
23 
24 /******************************************************************************
25  * Implementation of BaseIntegral methods
26  */
27 
29 {}
30 
31 
32 /******************************************************************************
33  * Implementation of BulkIntegral methods
34  */
35 
37 {}
38 
39 
40 /******************************************************************************
41  * Implementation of EdgeIntegral methods
42  */
43 
44 EdgeIntegral::EdgeIntegral(std::shared_ptr<EvalPoints> eval_points, unsigned int dim, uint i_subset)
45 : BaseIntegral(eval_points, dim),
46  subset_index_(i_subset)
47 {
48 
49  begin_idx_ = eval_points_->subset_begin(dim_, subset_index_);
50  uint end_idx = eval_points_->subset_end(dim_, subset_index_);
51  n_sides_ = dim + 1;
52  //DebugOut() << "begin: " << begin_idx_ << "end: " << end_idx;
53  n_points_per_side_ = (end_idx - begin_idx_) / n_sides();
54  //DebugOut() << "points per side: " << n_points_per_side_;
55 
56 }
57 
59 }
60 
61 
62 /******************************************************************************
63  * Implementation of CouplingIntegral methods
64  */
65 
66 CouplingIntegral::CouplingIntegral(std::shared_ptr<EdgeIntegral> edge_integral, std::shared_ptr<BulkIntegral> bulk_integral)
67  : BaseIntegral(edge_integral->eval_points(), edge_integral->dim()),
68  edge_integral_(edge_integral), bulk_integral_(bulk_integral)
69 {
70  ASSERT_EQ(edge_integral->dim()-1, bulk_integral->dim());
71 }
72 
74 {
75  edge_integral_.reset();
76  bulk_integral_.reset();
77 }
78 
79 
80 
81 /******************************************************************************
82  * Implementation of BoundaryIntegral methods
83  */
84 
85 BoundaryIntegral::BoundaryIntegral(std::shared_ptr<EdgeIntegral> edge_integral, std::shared_ptr<BulkIntegral> bulk_integral)
86  : BaseIntegral(edge_integral->eval_points(), edge_integral->dim()),
87  edge_integral_(edge_integral), bulk_integral_(bulk_integral)
88 {}
89 
91 {
92  edge_integral_.reset();
93 }
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:333
unsigned int dim() const
Returns dimension.
Definition: eval_subset.hh:254
unsigned int dim_
Dimension of the cell on which points are placed.
Definition: eval_subset.hh:261
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
Definition: eval_subset.hh:259
virtual ~BaseIntegral()
Destructor.
Definition: eval_subset.cc:28
std::shared_ptr< EdgeIntegral > edge_integral_
Integral according to higher dim (bulk) element subset part in EvalPoints object.
Definition: eval_subset.hh:460
~BoundaryIntegral()
Destructor.
Definition: eval_subset.cc:90
BoundaryIntegral()
Default constructor.
Definition: eval_subset.hh:421
~BulkIntegral()
Destructor.
Definition: eval_subset.cc:36
CouplingIntegral()
Default constructor.
Definition: eval_subset.hh:372
std::shared_ptr< BulkIntegral > bulk_integral_
Integral according to bulk subset part (element of lower dim) in EvalPoints object.
Definition: eval_subset.hh:410
std::shared_ptr< EdgeIntegral > edge_integral_
Integral according to side subset part (element of higher dim) in EvalPoints object.
Definition: eval_subset.hh:408
~CouplingIntegral()
Destructor.
Definition: eval_subset.cc:73
EdgeIntegral()
Default constructor.
Definition: eval_subset.hh:310
uint n_points_per_side_
Number of points. TODO: pass this to the constructor, avoid extraction from the eval_points.
Definition: eval_subset.hh:356
unsigned int n_sides() const
Getter of n_sides.
Definition: eval_subset.hh:322
unsigned int subset_index_
Definition: eval_subset.hh:350
~EdgeIntegral()
Destructor.
Definition: eval_subset.cc:58
unsigned int n_sides_
Number of sides (value 0 indicates bulk set)
Definition: eval_subset.hh:354
unsigned int uint