Triangle6.hpp 5.34 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
///
////// \file
///
///
/// Created by Sebastien Gilles <sebastien.gilles@inria.fr> on the Tue, 18 Mar 2014 15:17:56 +0100
/// Copyright (c) Inria. All rights reserved.
///
/// \ingroup GeometryGroup
/// \addtogroup GeometryGroup
/// \{
11

12 13
#ifndef MOREFEM_x_GEOMETRY_x_REF_GEOMETRIC_ELT_x_INSTANCES_x_TRIANGLE_x_TRIANGLE6_HPP_
# define MOREFEM_x_GEOMETRY_x_REF_GEOMETRIC_ELT_x_INSTANCES_x_TRIANGLE_x_TRIANGLE6_HPP_
14

15 16 17
# include "Geometry/RefGeometricElt/Instances/Triangle/Topology/Triangle.hpp"
# include "Geometry/RefGeometricElt/Instances/Triangle/ShapeFunction/Triangle6.hpp"
# include "Geometry/RefGeometricElt/Instances/Triangle/Format/Triangle6.hpp"
18
    // < absolutely required to let MoReFEM know the format actually supported!
19

20 21
# include "Geometry/RefGeometricElt/Internal/RefGeomElt/RefGeomEltImpl.hpp"
# include "Geometry/RefGeometricElt/Internal/RefGeomElt/TRefGeomElt.hpp"
22 23


24
namespace MoReFEM
25
{
26 27


28
    namespace RefGeomEltNS
29
    {
30 31


32
        namespace Traits
33
        {
34 35


36
            /*!
37 38 39 40 41 42 43 44 45
             * \brief Traits class that holds the static functions related to shape functions, interface and topology.
             *
             * It can't be instantiated directly: its purpose is either to provide directly a data through
             * static function:
             *
             * \code
             * constexpr auto Nshape_function = Triangle6::NshapeFunction();
             * \endcode
             *
46
             * or to be a template parameter to MoReFEM::RefGeomEltNS::Triangle6 class (current class is in an
47 48 49
             * additional layer of namespace:
             *
             * \code
50
             * MoReFEM::RefGeomEltNS::Traits::Triangle6
51
             * \endcode
52 53
             *
             */
54
            class Triangle6 final
55
            : public ::MoReFEM::Internal::RefGeomEltNS::RefGeomEltImpl
56 57 58
            <
                Triangle6,
                ShapeFunctionNS::Triangle6,
59
                TopologyNS::Triangle
60
            >
61
            {
62

63
            protected:
64

65 66
                //! Convenient alias.
                using self = Triangle6;
67

68
                /// \name Special members: prevent direct instantiation of RefGeomEltImpl objects.
69
                ///@{
70

71 72
                //! Constructor.
                Triangle6() = default;
73

74 75
                //! Destructor.
                ~Triangle6() = default;
76

77 78
                //! Copy constructor.
                Triangle6(const Triangle6&) = delete;
79

80 81
                //! Move constructor.
                Triangle6(Triangle6&&) = delete;
82

83 84
                //! operator=.
                Triangle6& operator=(const Triangle6&) = delete;
85

86 87 88
                //! operator=.
                self& operator=(self&&) = delete;

89
                ///@}
90

91
            public:
92

93
                /*!
94
                 * \brief Name associated to the RefGeomElt.
95
                 *
96
                 * \return Name that is guaranteed to be unique (throught the GeometricEltFactory) and can
97 98
                 * therefore also act as an identifier.
                 */
99
                static const std::string& ClassName();
100

101 102
                //! Number of Coords required to describe fully a GeometricElt of this type.
                enum : unsigned int { Ncoords = 6u };
103

104
                /*!
105
                 * \brief Enum associated to the RefGeomElt.
106
                 *
107
                 * \return Enum value guaranteed to be unique (throught the GeometricEltFactory); its
108 109
                 * raison d'être is that many operations are much faster on an enumeration than on a string.
                 */
110
                static constexpr MoReFEM::Advanced::GeometricEltEnum Identifier()
111
                {
112
                    return MoReFEM::Advanced::GeometricEltEnum::Triangle6;
113
                }
114 115


116
            private:
117

118 119
                // THIS IS A TRAIT CLASS, NO MEMBERS ALLOWED HERE!

120 121


122
            };
123 124


125
        } //   namespace Traits
126 127 128



129
        /*!
130
         * \brief Acts as a strawman class for MoReFEM::RefGeomEltNS::Traits::Triangle6.
131 132
         *
         * The limitation with the traits class is that we can't use it polymorphically; we can't for instance
133
         * store in one dynamic container all the kinds of GeometricElt present in a mesh.
134
         *
135
         * That is the role of the following class: it derives polymorphically from RefGeomElt, and therefore
136 137 138
         * can be included in:
         *
         * \code
139
         * RefGeomElt::vector_shared_ptr geometric_types_in_mesh_;
140 141 142
         * \endcode
         *
         */
143
        class Triangle6 final
144
        : public ::MoReFEM::Internal::RefGeomEltNS::TRefGeomElt<Traits::Triangle6>
145 146
        {
        public:
147

148 149
            //! Constructor.
            Triangle6() = default;
150

151 152
            //! Destructor.
            ~Triangle6();
153

154 155
            //! Copy constructor.
            Triangle6(const Triangle6&) = delete;
156

157 158
            //! Move constructor.
            Triangle6(Triangle6&&) = delete;
159

160 161
            //! Copy affectation.
            Triangle6& operator=(const Triangle6&) = delete;
162

163 164 165
            //! Move affectation.
            Triangle6& operator=(Triangle6&&) = delete;

166

167 168


169
        private:
170

171
            // THIS CLASS IS NOT INTENDED TO HOLD DATA MEMBERS; please read its description first if you want to...
172 173


174

175 176
        };

177 178 179



180
    } // namespace RefGeomEltNS
181 182


183
} // namespace MoReFEM
184 185


186 187 188
/// @} // addtogroup GeometryGroup


189
#endif // MOREFEM_x_GEOMETRY_x_REF_GEOMETRIC_ELT_x_INSTANCES_x_TRIANGLE_x_TRIANGLE6_HPP_