___FILEBASENAME___.hpp 6.98 KB
Newer Older
1 2
//! \file 
//
3 4 5 6 7 8 9 10 11 12 13
//
//  ___FILENAME___
//  ___PROJECTNAME___
//
//  Created by ___FULLUSERNAME___ on ___DATE___.
//___COPYRIGHT___
//

#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____HPP
# define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____HPP

14
# include "Operators/GlobalVariationalOperator/GlobalVariationalOperator.hpp"
15

16
# include "Operators/LocalVariationalOperatorInstances/___VARIABLE_operatorNature___Form/___FILEBASENAMEASIDENTIFIER___.hpp"
17 18


19
namespace MoReFEM
20 21 22 23 24 25 26
{
    
    
    namespace GlobalVariationalOperatorNS
    {
        
        
27
        class ___FILEBASENAMEASIDENTIFIER___ final : public GlobalVariationalOperatorNS::SameForAllRefGeomElt
28 29
        <
            ___FILEBASENAMEASIDENTIFIER___,
30
            Advanced::LocalVariationalOperatorNS::___FILEBASENAMEASIDENTIFIER___
31 32 33 34 35
        >
        {
            
        public:
            
36
            //! \copydoc doxygen_hide_alias_self
37 38 39
            // \TODO This might seem a bit dumb but is actually very convenient for template classes.
            using self = ___FILEBASENAMEASIDENTIFIER___;
            
GILLES Sebastien's avatar
GILLES Sebastien committed
40
            //! Alias to unique pointer.
41
            using const_unique_ptr = std::unique_ptr<const self>;
42 43
            
            //! Returns the name of the operator.
44
            static const std::string& ClassName();
45
            
46 47 48
            //! Alias to local operator.
            using local_operator_type = Advanced::LocalVariationalOperatorNS::___FILEBASENAMEASIDENTIFIER___;
            
49
            //! Convenient alias to pinpoint the GlobalVariationalOperator parent.
50
            using parent = GlobalVariationalOperatorNS::SameForAllRefGeomElt
51
            <
52 53
                self,
                local_operator_type
54 55 56
            >;
            
            //! Friendship to the parent class so that the CRTP can reach private methods defined below.
57
            friend parent;
58 59 60 61 62 63 64 65

            
            
        public:
            
            /// \name Special members.
            ///@{
            
66 67 68
            /*!
             * \brief Constructor.
             *
69
             * \copydoc doxygen_hide_quadrature_rule_per_topology_nullptr_arg
70
             */
71
            explicit ___FILEBASENAMEASIDENTIFIER___(const FEltSpace& felt_space,
72
                                                    const Unknown& unknown,
73
                                                    // POSSIBLY ANOTHER UNKNOWN IF 2 UNKNOWN OPERATOR
74
                                                    unsigned int mesh_dimension,
75
                                                    DoComputeProcessorWiseLocal2Global do_consider_processor_wise_local_2_global, // If not locked by the operator (for instance probably yes for non linear operators)
76
                                                    // POSSIBLY ADDITIONAL ARGUMENTS SPECIFIC TO OPERATOR
77
                                                    const QuadratureRulePerTopology* const quadrature_rule_per_topology
78 79 80 81 82
                                                    );
            
            //! Destructor.
            ~___FILEBASENAMEASIDENTIFIER___() = default;
            
83 84
            //! \copydoc doxygen_hide_copy_constructor
            ___FILEBASENAMEASIDENTIFIER___(const ___FILEBASENAMEASIDENTIFIER___& rhs) = delete;
85
            
86 87
            //! \copydoc doxygen_hide_move_constructor
            ___FILEBASENAMEASIDENTIFIER___(___FILEBASENAMEASIDENTIFIER___&& rhs) = delete;
88
            
89
            //! \copydoc doxygen_hide_copy_affectation
90
            ___FILEBASENAMEASIDENTIFIER___& operator=(const ___FILEBASENAMEASIDENTIFIER___& rhs) = delete;
91
            
92
            //! \copydoc doxygen_hide_move_affectation
93
            ___FILEBASENAMEASIDENTIFIER___& operator=(___FILEBASENAMEASIDENTIFIER___&& rhs) = delete;
94 95 96 97 98 99
            
            ///@}
         
            
        public:
            
100 101 102
            // TODO Remove matrix references in the text if linear operator.
            // TODO Remove vector references in the text if bilinear operator.
            
103
            /*!
104
             * \brief Assemble into one or several matrices and/or vectors.
105
             *
106 107
             * \tparam LinearAlgebraTupleT A tuple that may include \a GlobalMatrixWithCoefficient and/or
             * \a GlobalVectorWithCoefficient objects. Ordering doesn't matter.
108
             *
109 110
             * \param[in] linear_algebra_tuple List of global matrices and/or vectors into which the operator is
             * assembled. These objects are assumed to be already properly allocated.
111 112 113 114
             * \param[in] domain Domain upon which the assembling takes place. Beware: if this domain is not a subset
             * of the finite element space, assembling can only occur in a subset of the domain defined in the finite
             * element space; if current \a domain is not a subset of finite element space one, assembling will occur
             * upon the intersection of both.
115 116
             *
             */
117
            
118 119
            template<class LinearAlgebraTupleT>
            void Assemble(LinearAlgebraTupleT&& global_matrix_with_coeff_list, const Domain& domain = Domain()) const;
120 121 122 123 124
            
            
        private:
            
            // \TODO If your operator doesn't have any supplementary argument, just delete the method below.
GILLES Sebastien's avatar
GILLES Sebastien committed
125 126
            // If not, it must set data attributes in LocalVariationalOperator for the parameters required at the local level.
            // You should have a look to SecondPiolaKirchhoffStressTensor or TransientSource operator to
127 128 129 130 131 132
            // catch the drift of it.
            
            /*!
             * \brief Computes the additional arguments required by the AssembleWithVariadicArguments() method as
             * a tuple.
             *
133 134
             * \param[in] local_operator Local operator in charge of the elementary computation. A  mutable work
             * variable is actually set in this call.
135 136
             * \param[in] local_felt_space List of finite elements being considered; all those related to the
             * same GeometricElt.
137 138 139 140
             * \param[in] additional_arguments Additional arguments given to PerformElementaryCalculation().
             * These arguments might need treatment before being given to ComputeEltArray: for instance if there
             * is a GlobalVector that reflects a previous state, ComputeEltArray needs only the dofs that are
             * relevant locally.
141
             */
142
            template<class LocalOperatorTypeT>
143
            void
144
            SetComputeEltArrayArguments(const LocalFEltSpace& local_felt_space,
145
                                        LocalOperatorTypeT& local_operator,
146
                                        const std::tuple</* Add here the list of types of GlobalVariational operator to be 'converted' for the LocalVariationalOperator.*/>& additional_arguments) const;
147 148 149 150 151
            
            
        };
        
        
152
    } // namespace GlobalVariationalOperatorNS
153 154
    
    
155
} // namespace MoReFEM
156 157


158
# include "OperatorInstances/VariationalOperator/___VARIABLE_operatorNature___Form/___FILEBASENAME___.hxx"
159 160


161
#endif