Flow123d  JS_before_hm-1712-g4d968e368
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, unsigned int n_permutations, unsigned int points_per_side)
45 : BaseIntegral(eval_points, dim), subset_index_(eval_points_->n_subsets(dim)), n_permutations_(n_permutations) {
46  n_sides_ = dim_+1;
47  perm_indices_ = new unsigned int** [n_sides_];
48  for (unsigned int i_side=0; i_side<n_sides_; ++i_side) {
49  perm_indices_[i_side] = new unsigned int* [n_permutations_];
50  for (unsigned int i_perm=0; i_perm<n_permutations_; ++i_perm) {
51  perm_indices_[i_side][i_perm] = new unsigned int [points_per_side];
52  }
53  }
54 }
55 
57  for (unsigned int i_side=0; i_side<n_sides_; ++i_side) {
58  for (unsigned int i_perm=0; i_perm<n_permutations_; ++i_perm) {
59  delete perm_indices_[i_side][i_perm];
60  }
61  delete perm_indices_[i_side];
62  }
63  delete perm_indices_;
64 }
65 
66 
67 /******************************************************************************
68  * Implementation of CouplingIntegral methods
69  */
70 
71 CouplingIntegral::CouplingIntegral(std::shared_ptr<EdgeIntegral> edge_integral, std::shared_ptr<BulkIntegral> bulk_integral)
72  : BaseIntegral(edge_integral->eval_points(), edge_integral->dim()), edge_integral_(edge_integral), bulk_integral_(bulk_integral) {
73  ASSERT_EQ_DBG(edge_integral->dim(), bulk_integral->dim());
74 }
75 
77  edge_integral_.reset();
78  bulk_integral_.reset();
79 }
80 
81 
82 
83 /******************************************************************************
84  * Implementation of BoundaryIntegral methods
85  */
86 
87 BoundaryIntegral::BoundaryIntegral(std::shared_ptr<EdgeIntegral> edge_integral, std::shared_ptr<BulkIntegral> bulk_integral)
88  : BaseIntegral(edge_integral->eval_points(), edge_integral->dim()), edge_integral_(edge_integral), bulk_integral_(bulk_integral) {}
89 
91  edge_integral_.reset();
92 }
EdgeIntegral::n_sides_
unsigned int n_sides_
Number of sides (value 0 indicates bulk set)
Definition: eval_subset.hh:349
eval_subset.hh
CouplingIntegral::CouplingIntegral
CouplingIntegral()
Default constructor.
Definition: eval_subset.hh:365
eval_points.hh
ASSERT_EQ_DBG
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
BaseIntegral::dim_
unsigned int dim_
Dimension of points.
Definition: eval_subset.hh:269
EdgeIntegral::~EdgeIntegral
~EdgeIntegral()
Destructor.
Definition: eval_subset.cc:56
EdgeIntegral::n_permutations_
unsigned int n_permutations_
Number of permutations (value 0 indicates bulk set)
Definition: eval_subset.hh:351
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:438
BaseIntegral::~BaseIntegral
virtual ~BaseIntegral()
Destructor.
Definition: eval_subset.cc:28
BoundaryIntegral::BoundaryIntegral
BoundaryIntegral()
Default constructor.
Definition: eval_subset.hh:408
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:395
BaseIntegral
Definition: eval_subset.hh:244
EdgeIntegral::perm_indices_
unsigned int *** perm_indices_
Indices to EvalPoints for different sides and permutations reflecting order of points.
Definition: eval_subset.hh:347
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:76
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:397