escript  Revision_
ReferenceElementSets.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 #ifndef __FINLEY_REFERENCEELEMENTSETS_H__
18 #define __FINLEY_REFERENCEELEMENTSETS_H__
19 
20 #include "ReferenceElements.h"
21 
22 namespace finley {
23 
27  ReferenceElementSet(ElementTypeId id, int order, int reduced_order)
28  {
31  id_info->BasisFunctions);
32  if (!noError()) return;
33 
34  if (order<0)
35  order=std::max(2*bf_info->numOrder, 0);
36 
37  referenceElement.reset(new ReferenceElement(id, order));
38  if (noError()) {
39  if (reduced_order<0)
40  reduced_order=std::max(2*(bf_info->numOrder-1), 0);
42  new ReferenceElement(id, reduced_order));
43  }
44 
45  if (noError()) {
46  if (referenceElement->getNumNodes() != referenceElementReducedQuadrature->getNumNodes()) {
47  setError(VALUE_ERROR, "ReferenceElementSet: numNodes in referenceElement and referenceElementReducedQuadrature don't match.");
48  }
49  }
50  }
51 
52  const_ShapeFunction_ptr borrowBasisFunctions(bool reducedShapefunction,
53  bool reducedIntegrationOrder) const
54  {
55  if (reducedShapefunction) {
56  return (reducedIntegrationOrder ?
57  referenceElementReducedQuadrature->LinearBasisFunctions :
58  referenceElement->LinearBasisFunctions);
59  }
60  return (reducedIntegrationOrder ?
61  referenceElementReducedQuadrature->BasisFunctions :
62  referenceElement->BasisFunctions);
63  }
64 
65  const_ShapeFunction_ptr borrowParametrization(bool reducedIntegrationOrder) const
66  {
67  return (reducedIntegrationOrder ?
68  referenceElementReducedQuadrature->Parametrization :
69  referenceElement->Parametrization);
70  }
71 
73  {
74  return (reducedIntOrder ? referenceElementReducedQuadrature :
76  }
77 
78  inline int getNumNodes() const { return referenceElement->getNumNodes(); }
79 
82 };
83 
84 
85 typedef boost::shared_ptr<const ReferenceElementSet> const_ReferenceElementSet_ptr;
86 
87 
88 } // namespace finley
89 
90 #endif // __FINLEY_REFERENCEELEMENTSETS_H__
91 
static const ShapeFunctionInfo * getInfo(ShapeFunctionTypeId id)
Definition: ShapeFunctions.cpp:104
boost::shared_ptr< const ReferenceElementSet > const_ReferenceElementSet_ptr
Definition: ReferenceElementSets.h:85
const_ShapeFunction_ptr borrowParametrization(bool reducedIntegrationOrder) const
Definition: ReferenceElementSets.h:65
static const ReferenceElementInfo * getInfo(ElementTypeId id)
returns the element information structure for the given type id
Definition: ReferenceElements.cpp:667
ReferenceElement_ptr referenceElement
Definition: ReferenceElementSets.h:81
Definition: ReferenceElementSets.h:26
ReferenceElementSet(ElementTypeId id, int order, int reduced_order)
Definition: ReferenceElementSets.h:27
void setError(ErrorCodeType err, const char *msg)
sets an error
Definition: Finley.cpp:43
const_ReferenceElement_ptr borrowReferenceElement(bool reducedIntOrder) const
Definition: ReferenceElementSets.h:72
Definition: finley/src/Assemble.h:32
ShapeFunctionTypeId BasisFunctions
shape function for the basis functions
Definition: ReferenceElements.h:145
bool noError()
checks if there is no error
Definition: Finley.cpp:49
boost::shared_ptr< const ReferenceElement > const_ReferenceElement_ptr
Definition: ReferenceElements.h:213
int getNumNodes() const
Definition: ReferenceElementSets.h:78
boost::shared_ptr< const ShapeFunction > const_ShapeFunction_ptr
Definition: ShapeFunctions.h:99
this struct holds the definition of the reference element
Definition: ReferenceElements.h:120
ElementTypeId
Definition: ReferenceElements.h:38
boost::shared_ptr< ReferenceElement > ReferenceElement_ptr
Definition: ReferenceElements.h:212
const_ShapeFunction_ptr borrowBasisFunctions(bool reducedShapefunction, bool reducedIntegrationOrder) const
Definition: ReferenceElementSets.h:52
Definition: error.h:45
this struct holds the definition of the shape functions on an element
Definition: ShapeFunctions.h:57
this struct holds the realization of a reference element
Definition: ReferenceElements.h:176
ReferenceElement_ptr referenceElementReducedQuadrature
Definition: ReferenceElementSets.h:80
int numOrder
order of the shape functions
Definition: ShapeFunctions.h:67