Browse Source

Looking for memory leak, not found yet.

enhancement_3
Trevor Irons 8 years ago
parent
commit
9495039bef

+ 2
- 2
Modules/FDEM1D/CMakeLists.txt View File

23
 
23
 
24
 # Install
24
 # Install
25
 install ( TARGETS fdem1d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
25
 install ( TARGETS fdem1d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
26
-install ( FILES include/FDEM1D  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ ) 
27
-install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "*.h")
26
+install ( FILES include/FDEM1D  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma ) 
27
+install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma  FILES_MATCHING PATTERN "*.h")
28
 
28
 
29
 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "FDEM1D")
29
 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "FDEM1D")
30
 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/FDEM1D  FILES_MATCHING PATTERN "*.h")
30
 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/FDEM1D  FILES_MATCHING PATTERN "*.h")

+ 2
- 2
Modules/FDEM1D/examples/EMDipEarth1D.cpp View File

99
 	//std::cout << receivers->GetEfield(0) << std::endl;
99
 	//std::cout << receivers->GetEfield(0) << std::endl;
100
 	//std::cout << receivers->GetHfield(1) << std::endl;
100
 	//std::cout << receivers->GetHfield(1) << std::endl;
101
 	//std::cout << receivers->GetEfield(1) << std::endl;
101
 	//std::cout << receivers->GetEfield(1) << std::endl;
102
-	receivers->ClearFields();
102
+	//receivers->ClearFields();
103
 
103
 
104
     // swap tx rx posigion
104
     // swap tx rx posigion
105
     /*
105
     /*
110
 	receivers->ClearFields();
110
 	receivers->ClearFields();
111
     */
111
     */
112
 
112
 
113
- #ifdef KIHALEE_EM1D
113
+ #ifdef NOKIHALEE_EM1D
114
     std::cout << "\nFORTRAN\n";
114
     std::cout << "\nFORTRAN\n";
115
  	EmEarth->MakeCalc();
115
  	EmEarth->MakeCalc();
116
 // 	std::cout << receivers->GetHfield(0,0) << std::endl;
116
 // 	std::cout << receivers->GetHfield(0,0) << std::endl;

+ 4
- 4
Modules/FDEM1D/include/KernelEM1DManager.h View File

147
             std::vector< std::shared_ptr<KernelEM1DBase> >  KernelVec;
147
             std::vector< std::shared_ptr<KernelEM1DBase> >  KernelVec;
148
 
148
 
149
             /** Reflection base used for TE mode */
149
             /** Reflection base used for TE mode */
150
-            std::shared_ptr<KernelEM1DReflBase>        TEReflBase;
150
+            std::shared_ptr<KernelEM1DReflBase>        TEReflBase = nullptr;
151
 
151
 
152
             /** Reflection base used for TM mode */
152
             /** Reflection base used for TM mode */
153
-            std::shared_ptr<KernelEM1DReflBase>        TMReflBase;
153
+            std::shared_ptr<KernelEM1DReflBase>        TMReflBase = nullptr;
154
 
154
 
155
             /** EmEarth Class */
155
             /** EmEarth Class */
156
             std::shared_ptr<LayeredEarthEM>            Earth;
156
             std::shared_ptr<LayeredEarthEM>            Earth;
175
     int KernelEM1DManager::AddKernel( ) {
175
     int KernelEM1DManager::AddKernel( ) {
176
 
176
 
177
         auto NewKern = KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::NewSP();
177
         auto NewKern = KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::NewSP();
178
-        KernelVec.push_back( NewKern );
179
-        NewKern->managerIdx = KernelVec.size()-1;
178
+        NewKern->managerIdx = KernelVec.size();
180
         switch (Mode) {
179
         switch (Mode) {
181
             case TE:
180
             case TE:
182
                 if (TEReflBase == nullptr) {
181
                 if (TEReflBase == nullptr) {
197
                 NewKern->SetReflBase(TMReflBase);
196
                 NewKern->SetReflBase(TMReflBase);
198
                 break;
197
                 break;
199
         }
198
         }
199
+        KernelVec.push_back( std::move(NewKern) );
200
         return static_cast<int>(KernelVec.size()-1);
200
         return static_cast<int>(KernelVec.size()-1);
201
      }
201
      }
202
 
202
 

+ 1
- 1
Modules/FDEM1D/include/KernelEM1DReflBase.h View File

211
 			EMMODE mode;
211
 			EMMODE mode;
212
 
212
 
213
             /// Pointer to layered earth
213
             /// Pointer to layered earth
214
-            std::shared_ptr<LayeredEarthEM> Earth;
214
+            std::shared_ptr<LayeredEarthEM> Earth = nullptr;
215
 
215
 
216
 			Complex       uk;
216
 			Complex       uk;
217
 			Complex       um;
217
 			Complex       um;

+ 2
- 2
Modules/LemmaCore/CMakeLists.txt View File

32
 
32
 
33
 # Install
33
 # Install
34
 install (  TARGETS lemmacore DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
34
 install (  TARGETS lemmacore DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
35
-install ( FILES include/LemmaCore  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ ) 
36
-install ( DIRECTORY include/       DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "*.h" )
35
+install ( FILES include/LemmaCore  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma ) 
36
+install ( DIRECTORY include/       DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma  FILES_MATCHING PATTERN "*.h" )
37
 
37
 
38
 # Examples
38
 # Examples
39
 if (LEMMA_BUILD_EXAMPLES)
39
 if (LEMMA_BUILD_EXAMPLES)

Loading…
Cancel
Save