Flow123d  JS_before_hm-2153-g6b139422c
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_DBG(edge_integral->dim(), 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 }
EdgeIntegral::n_sides_
unsigned int n_sides_
Number of sides (value 0 indicates bulk set)
Definition: eval_subset.hh:354
eval_subset.hh
CouplingIntegral::CouplingIntegral
CouplingIntegral()
Default constructor.
Definition: eval_subset.hh:372
eval_points.hh
BaseIntegral::eval_points_
std::shared_ptr< EvalPoints > eval_points_
Pointer to EvalPoints.
Definition: eval_subset.hh:259
ASSERT_EQ_DBG
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
uint
unsigned int uint
Definition: mh_dofhandler.hh:101
BaseIntegral::dim_
unsigned int dim_
Dimension of the cell on which points are placed.
Definition: eval_subset.hh:261
BaseIntegral::dim
unsigned int dim() const
Returns dimension.
Definition: eval_subset.hh:254
EdgeIntegral::~EdgeIntegral
~EdgeIntegral()
Destructor.
Definition: eval_subset.cc:58
BoundaryIntegral::edge_integral_
std::shared_ptr< EdgeIntegral > edge_integral_
Integral according to higher dim (bulk) element subset part in EvalPoints object.
Definition: eval_subset.hh:460
EdgeIntegral::begin_idx_
uint begin_idx_
Definition: eval_subset.hh:351
EdgeIntegral::n_sides
unsigned int n_sides() const
Getter of n_sides.
Definition: eval_subset.hh:322
BaseIntegral::~BaseIntegral
virtual ~BaseIntegral()
Destructor.
Definition: eval_subset.cc:28
BoundaryIntegral::BoundaryIntegral
BoundaryIntegral()
Default constructor.
Definition: eval_subset.hh:421
BulkIntegral::~BulkIntegral
~BulkIntegral()
Destructor.
Definition: eval_subset.cc:36
CouplingIntegral::edge_integral_
std::shared_ptr< EdgeIntegral > edge_integral_
Integral according to side subset part (element of higher dim) in EvalPoints object.
Definition: eval_subset.hh:408
BaseIntegral
Definition: eval_subset.hh:236
EdgeIntegral::n_points_per_side_
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
EdgeIntegral::subset_index_
unsigned int subset_index_
Definition: eval_subset.hh:350
EdgeIntegral::EdgeIntegral
EdgeIntegral()
Default constructor.
Definition: eval_subset.hh:310
field_value_cache.hh
BoundaryIntegral::~BoundaryIntegral
~BoundaryIntegral()
Destructor.
Definition: eval_subset.cc:90
CouplingIntegral::~CouplingIntegral
~CouplingIntegral()
Destructor.
Definition: eval_subset.cc:73
CouplingIntegral::bulk_integral_
std::shared_ptr< BulkIntegral > bulk_integral_
Integral according to bulk subset part (element of lower dim) in EvalPoints object.
Definition: eval_subset.hh:410