MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Model.cpp 5.21 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
//  Model.cpp
//  HappyHeart
//
//  Created by Sebastien Gilles on 28/07/15.
//  Copyright (c) 2015 Inria. All rights reserved.
//

#include "Core/InputParameter/Result.hpp"

//#include "Operators/InterpolationOperatorInstances/P1_2_P2.hpp"

#include "Test/Operators/P1_to_P2/Model.hpp"


namespace HappyHeart
{
    
    
    namespace P1_to_P2_NS
    {


        Model::Model(const Wrappers::Mpi& mpi_ptr,
                     const InputParameterList& input_parameter_data)
        : parent(mpi_ptr, input_parameter_data),
        output_directory_(Utilities::InputParameterListNS::Extract<InputParameter::Result::OutputDirectory>::Path(input_parameter_data))
        { }
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
        
        
        namespace // anonymous
        {
            
            
            template<class InterpolatorT>
            void WriteInterpolatorMatrix(const InterpolatorT& interpolator,
                                         const std::string& output_directory,
                                         const Wrappers::Mpi& mpi)
            {
                
                const auto& matrix = interpolator.GetInterpolationMatrix();
                
                std::ostringstream oconv;
                oconv << output_directory << "/interpolation" << matrix.GetColNumberingSubset().GetUniqueId() << '_'
                << matrix.GetRowNumberingSubset().GetUniqueId() << ".hhdata";
                
                std::string output_file(oconv.str());
                
                if (mpi.IsRootProcessor())
                {
                    if (File::DoExist(output_file))
52
                        File::Remove(output_file, __FILE__, __LINE__);
53
54
55
56
57
58
59
60
61
62
63
                }
                
                mpi.Barrier();
                
                matrix.View(mpi, output_file, __FILE__, __LINE__);
                
            }
            
            
        } // namespace anonymous

64
65
66
67
68
69
70

        void Model::SupplInitialize(const InputParameterList& input_parameter_data)
        {
            static_cast<void>(input_parameter_data);
            
            const auto& god_of_dof = GetGodOfDof(1);
            
71
            const auto& source_felt_space = god_of_dof.GetFEltSpace(1);
72
            const auto& target_felt_space = god_of_dof.GetFEltSpace(2);
73
            
74
75
76
77
            
            // \todo #67
            const auto& source_numbering_subset = *source_felt_space.GetNumberingSubsetList()[0];
            const auto& target_numbering_subset = *target_felt_space.GetNumberingSubsetList()[0];
78
            
79
80
81
82
            const auto& unknown_manager = UnknownManager::GetInstance();
            
            const auto& velocity_ptr = unknown_manager.GetUnknownPtr(EnumUnderlyingType(UnknownIndex::velocity));
            const auto& p2_velocity_ptr = unknown_manager.GetUnknownPtr(EnumUnderlyingType(UnknownIndex::p2_velocity));
83
84
85
            const auto& output_directory = GetOutputDirectory();
            const auto& mpi = MpiHappyHeart();

86
87
            
            {
88
                ConformInterpolatorNS::pairing_type&& pairing
89
                {
90
                    { velocity_ptr, p2_velocity_ptr }
91
92
93
                };
                
            
94
                interpolator_p1_p2_ = std::make_unique<ConformInterpolatorNS::P1_to_P2>(source_felt_space,
95
                                                                                           source_numbering_subset,
96
                                                                                           target_felt_space,
97
98
99
                                                                                           target_numbering_subset,
                                                                                           std::move(pairing));
                
100
101
102
103
104
105
106
107
                
                interpolator_p1_p2_->Init();
                
                WriteInterpolatorMatrix(*interpolator_p1_p2_,
                                        output_directory,
                                        mpi);

                
108
109
110
111
            }
            
            {
                
112
                ConformInterpolatorNS::pairing_type&& pairing
113
114
115
                {
                    { p2_velocity_ptr, velocity_ptr }
                };
116
                
117
                interpolator_p2_p1_ = std::make_unique<ConformInterpolatorNS::P2_to_P1>(target_felt_space,
118
                                                                                           target_numbering_subset,
119
                                                                                           source_felt_space,
120
121
                                                                                           source_numbering_subset,
                                                                                           std::move(pairing));
122
123
124
125
126
127
128
129
                
                interpolator_p2_p1_->Init();
                
                
                WriteInterpolatorMatrix(*interpolator_p2_p1_,
                                        output_directory,
                                        mpi);
                
130
            }
GILLES Sebastien's avatar
GILLES Sebastien committed
131
        
132
133
134
135
136
137
138
139
140
141
142
        }


        void Model::Forward()
        { }


        void Model::SupplFinalizeStep()
        { }
        

143
        void Model::SupplFinalize()
GILLES Sebastien's avatar
GILLES Sebastien committed
144
        { }
145
146
147
148
149
150


    } // namespace P1_to_P2_NS


} // namespace HappyHeart