Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
IntegrationList.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_IntegrationList_H_
9#define model_IntegrationList_H_
10
11#include <deque>
12#include <utility> // std::pair, std::make_pair
13#include <chrono>
14#include <Quadrature.h>
15
16#include <BarycentricTraits.h>
17//#include <TestExpression.h>
18//#include <LinearWeakList.h>
19
20namespace model
21{
22
23 /**************************************************************************/
24 /**************************************************************************/
25 template <int dimMinusDomainDim, typename PointType>
27
28 template <typename PointType>
29 struct IntegrationList<0,PointType> : public std::deque<PointType>
30 {
31// static_assert(0,"NOT IMPLEMENTED YET");
32 };
33
34
35 template <typename PointType>
36 struct IntegrationList<1,PointType> : public std::deque<PointType>
37 {
38 std::shared_ptr<const void> domainOwner;
39
40 /**********************************************************************/
41 template<typename IntegrationDomainType>
42 IntegrationList(const IntegrationDomainType& domain):
43 domainOwner(std::make_shared<IntegrationDomainType>(domain))
44 {
45 domain.validate();
46
47 typedef typename IntegrationDomainType::ElementType ElementType;
48 typedef typename IntegrationDomainType::QuadratureType QuadratureType;
49
50// std::cout<<"Creating surface IntegrationList (size "<<this->size()<<"->"<<std::flush;
51// const auto t0= std::chrono::system_clock::now();
52 for (size_t k=0;k<domain.size();++k)
53 {
54 const ElementType& ele(*domain[k].first); // element ID
55 const int f(domain[k].second); // face ID
56 for(unsigned int q=0;q<QuadratureType::quadratureOrder;++q)
57 {
58 const Eigen::Matrix<double,ElementType::dim,1> faceBary(BarycentricTraits<ElementType::dim-1>::x2l(QuadratureType::abscissa(q)));
59 const Eigen::Matrix<double,ElementType::dim+1,1> domainBary(BarycentricTraits<ElementType::dim>::face2domainBary(faceBary,f));
60 this->emplace_back(ele,domainBary,f,QuadratureType::weight(q));
61 }
62
63 }
64// std::cout<<this->size()<<") ["<<(std::chrono::duration<double>(std::chrono::system_clock::now()-t0)).count()<<" sec]"<<std::endl;
65 }
66
67 };
68
69 template <typename PointType>
70 struct IntegrationList<2,PointType> : public std::deque<PointType>
71 {
72
73// /**********************************************************************/
74// template<typename IntegrationDomainType>
75// IntegrationList(const IntegrationDomainType& domain)
76// {
77//
78// typedef typename IntegrationDomainType::ElementType ElementType;
79// typedef typename IntegrationDomainType::QuadratureType QuadratureType;
80//
81// std::cout<<"Creating IntegrationList (size "<<this->size()<<"->"<<std::flush;
82// const auto t0= std::chrono::system_clock::now();
83// for (size_t k=0;k<domain.size();++k)
84// {
85// const ElementType& ele(*domain[k].first); // element ID
86// const int f(domain[k].second); // face ID
87// for(unsigned int q=0;q<QuadratureType::quadratureOrder;++q)
88// {
89// const Eigen::Matrix<double,ElementType::dim,1> faceBary(BarycentricTraits<ElementType::dim-1>::x2l(QuadratureType::abscissa(q)));
90// const Eigen::Matrix<double,ElementType::dim+1,1> domainBary(BarycentricTraits<ElementType::dim>::face2domainBary(faceBary,f));
91// this->emplace_back(ele,domainBary,f,QuadratureType::weight(q));
92// }
93//
94// }
95// std::cout<<this->size()<<") ["<<(std::chrono::duration<double>(std::chrono::system_clock::now()-t0)).count()<<" sec]"<<std::endl;
96// }
97
98 };
99
100
101
102
103
104} // close namespace
105#endif
the magnitude of the R vector q
function int_R syms a b c u real f
Definition int_R.m:4
static VectorHigherDimD x2l(const VectorDimD &X)
static Eigen::Matrix< double, dim+1, 1 > face2domainBary(const Eigen::Matrix< double, dim, 1 > &b1, const int &boundaryFace)
IntegrationList(const IntegrationDomainType &domain)
std::shared_ptr< const void > domainOwner
int k
vertex first