Segment3.hpp 5.3 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_SEGMENT_x_SEGMENT3_HPP_
# define MOREFEM_x_GEOMETRY_x_REF_GEOMETRIC_ELT_x_INSTANCES_x_SEGMENT_x_SEGMENT3_HPP_
14 15


16 17
# include "Geometry/RefGeometricElt/Internal/RefGeomElt/TRefGeomElt.hpp"
# include "Geometry/RefGeometricElt/Internal/RefGeomElt/RefGeomEltImpl.hpp"
18

19 20 21
# include "Geometry/RefGeometricElt/Instances/Segment/ShapeFunction/Segment3.hpp"
# include "Geometry/RefGeometricElt/Instances/Segment/Topology/Segment.hpp"
# include "Geometry/RefGeometricElt/Instances/Segment/Format/Segment3.hpp"
22
    // < absolutely required to let MoReFEM know the format actually supported!
23

24

25
namespace MoReFEM
26
{
27 28


29
    namespace RefGeomEltNS
30
    {
31 32


33
        namespace Traits
34
        {
35 36


37
            /*!
38 39 40 41 42 43 44 45 46
             * \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 = Segment3::NshapeFunction();
             * \endcode
             *
47
             * or to be a template parameter to MoReFEM::RefGeomEltNS::Segment3 class (current class is in an
48 49 50
             * additional layer of namespace:
             *
             * \code
51
             * MoReFEM::RefGeomEltNS::Traits::Segment3
52
             * \endcode
53 54
             *
             */
55
            class Segment3 final
56
            : public ::MoReFEM::Internal::RefGeomEltNS::RefGeomEltImpl
57 58 59
            <
                Segment3,
                ShapeFunctionNS::Segment3,
60
                TopologyNS::Segment
61
            >
62
            {
63

64

65
            protected:
66

67 68 69
                //! Convenient alias.
                using self = Segment3;

70

71
                /// \name Special members: prevent direct instantiation of RefGeomEltImpl objects.
72
                ///@{
73

74 75
                //! Constructor.
                Segment3() = default;
76

77 78
                //! Destructor.
                ~Segment3() = default;
79

80 81
                //! Copy constructor.
                Segment3(const Segment3&) = delete;
82

83 84
                //! Move constructor.
                Segment3(Segment3&&) = delete;
85

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

89 90 91
                //! operator=.
                self& operator=(self&&) = delete;

92
                ///@}
93

94
            public:
95

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

104 105
                //! Number of Coords required to describe fully a GeometricElt of this type.
                enum : unsigned int { Ncoords = 3u };
106

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


119
            private:
120

121 122
                // THIS IS A TRAIT CLASS, NO MEMBERS ALLOWED HERE!

123 124 125



126
            };
127 128 129



130
        } // namespace Traits
131 132 133 134




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

154 155
            //! Constructor.
            Segment3() = default;
156

157 158
            //! Destructor.
            ~Segment3();
159

160 161
            //! Copy constructor.
            Segment3(const Segment3&) = delete;
162

163 164
            //! Move constructor.
            Segment3(Segment3&&) = delete;
165

166 167
            //! Copy affectation.
            Segment3& operator=(const Segment3&) = delete;
168

169 170
            //! Move affectation.
            Segment3& operator=(Segment3&&) = delete;
171 172


173
        private:
174

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

177 178


179 180
        };

181 182


183
    } // namespace RefGeomEltNS
184 185


186
} // namespace MoReFEM
187 188


189 190 191
/// @} // addtogroup GeometryGroup


192
#endif // MOREFEM_x_GEOMETRY_x_REF_GEOMETRIC_ELT_x_INSTANCES_x_SEGMENT_x_SEGMENT3_HPP_