-
Notifications
You must be signed in to change notification settings - Fork 4
Refactor iterator [1/N] #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,10 @@ | |||
|
|||
class SimulationParameters{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class will be expanded significantly in later PRs
The reason why This patch should do the trick: diff --git a/tdms/src/electric_field.cpp b/tdms/src/electric_field.cpp
index 0e02b64..f338606 100644
--- a/tdms/src/electric_field.cpp
+++ b/tdms/src/electric_field.cpp
@@ -1,5 +1,5 @@
-#include <complex>
#include "globals.h"
+#include <complex>
#include "field.h"
using namespace std;
diff --git a/tdms/src/iterator.cpp b/tdms/src/iterator.cpp
index 01a6aff..f47e67e 100644
--- a/tdms/src/iterator.cpp
+++ b/tdms/src/iterator.cpp
@@ -4,6 +4,7 @@
* such as phasor extraction etc. Works in both pulsed
* and steady state mode.
******************************************************************/
+#include "globals.h"
#include <complex>
#include <algorithm>
#include <cstring>
@@ -15,7 +16,6 @@
#include "numeric.h"
#include "mesh_base.h"
#include "numerical_derivative.h"
-#include "globals.h"
#include "matlabio.h"
#include "mesh_base.h"
#include "timer.h"
diff --git a/tdms/src/magnetic_field.cpp b/tdms/src/magnetic_field.cpp
index 3c8a7e6..6f585d4 100644
--- a/tdms/src/magnetic_field.cpp
+++ b/tdms/src/magnetic_field.cpp
@@ -1,5 +1,5 @@
-#include <complex>
#include "globals.h"
+#include <complex>
#include "field.h"
using namespace std;
diff --git a/tdms/src/numerical_derivative.cpp b/tdms/src/numerical_derivative.cpp
index 78e888c..85df4f2 100644
--- a/tdms/src/numerical_derivative.cpp
+++ b/tdms/src/numerical_derivative.cpp
@@ -1,7 +1,7 @@
+#include "globals.h"
#include <cmath>
#include <cstdlib>
#include <fftw3.h>
-#include "globals.h"
#include "numerical_derivative.h"
#include "matlabio.h" |
thanks for investigating! I'd be rather inclined to leave the it as is, because adding in a constraint on ordering header files is a little annoying, imo |
Remove unused pointers Don't throw with unused Add pkg executable Refactor numeric.cpp Refactor numerical_derivative Start iterator refactor Add timers Add catch2 fetch message Don't narrow int Doc + indentation + type decl Delete unused pragmas on CI Add simulation params struct remove unused globals Extract angular norms Add H field test Fix time order Use relative difference Use built in pi constant Use langle rangle auto types Include math defines Delete unused code Fix typo in tdms/include/globals.h Revert pi import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes all look reasonable
Works towards closing #63 . This PR:
E
and magneticH
fieldsTimer
class suitable for printing intervals and recording the time between starts and ends. Maximises code reuse and more clearly expresses intentionphasor_norm
functions (equiv. toextractPhasorENorm
andextractPhasorHNorm
)using namespace std
before including headersSimulationParameters
class to hold the full set of parameters required for the simulationmatlabio_globals.h
headercmath
mesh_base.cpp
With a view to have a modest diff this will be continued in other PRs
Timings
On an M1 Pro Macbook. Note that there is a few % margin of error between reruns.
Initial
Final
Dependencies