Flow123d  DF_patch_fe_data_tables-ab62eed
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 }
94 
95 
96 /******************************************************************************
97  * Temporary implementations. Intermediate step in implementation of PatcFEValues.
98  */
99 
100 unsigned int EdgePoint::side_idx() const {
102 }
103 
104 unsigned int CouplingPoint::side_idx() const {
105  return (this->side_begin_ - integral_->edge_integral_->begin_idx_) / integral_->edge_integral_->n_points_per_side_;
106 }
107 
108 unsigned int BoundaryPoint::side_idx() const {
109  return (this->side_begin_ - integral_->edge_integral_->begin_idx_) / integral_->edge_integral_->n_points_per_side_;;
110 }
#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:279
unsigned int dim_
Dimension of the cell on which points are placed.
Definition: eval_subset.hh:286
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
Definition: eval_subset.hh:284
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:487
~BoundaryIntegral()
Destructor.
Definition: eval_subset.cc:90
BoundaryIntegral()
Default constructor.
Definition: eval_subset.hh:448
const BoundaryIntegral * integral_
Pointer to edge point set.
Definition: eval_subset.hh:253
unsigned int side_idx() const override
Intermediate step in implementation of PatcFEValues.
Definition: eval_subset.cc:108
~BulkIntegral()
Destructor.
Definition: eval_subset.cc:36
CouplingIntegral()
Default constructor.
Definition: eval_subset.hh:399
std::shared_ptr< BulkIntegral > bulk_integral_
Integral according to bulk subset part (element of lower dim) in EvalPoints object.
Definition: eval_subset.hh:437
std::shared_ptr< EdgeIntegral > edge_integral_
Integral according to side subset part (element of higher dim) in EvalPoints object.
Definition: eval_subset.hh:435
~CouplingIntegral()
Destructor.
Definition: eval_subset.cc:73
unsigned int side_idx() const override
Intermediate step in implementation of PatcFEValues.
Definition: eval_subset.cc:104
const CouplingIntegral * integral_
Pointer to edge point set.
Definition: eval_subset.hh:225
EdgeIntegral()
Default constructor.
Definition: eval_subset.hh:335
uint n_points_per_side_
Number of points. TODO: pass this to the constructor, avoid extraction from the eval_points.
Definition: eval_subset.hh:381
unsigned int n_sides() const
Getter of n_sides.
Definition: eval_subset.hh:347
unsigned int subset_index_
Definition: eval_subset.hh:375
~EdgeIntegral()
Destructor.
Definition: eval_subset.cc:58
unsigned int n_sides_
Number of sides (value 0 indicates bulk set)
Definition: eval_subset.hh:379
unsigned int side_idx() const override
Intermediate step in implementation of PatcFEValues.
Definition: eval_subset.cc:100
const EdgeIntegral * integral_
Definition: eval_subset.hh:187
unsigned int side_begin_
Index of side in element.
Definition: eval_subset.hh:159
unsigned int uint