Skip to content

Commit d1bef79

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent a8b7ed6 commit d1bef79

File tree

156 files changed

+2022
-2111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2022
-2111
lines changed

arch/arch_device_cuda.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ namespace arch{
539539
printf("The blocksize (%u) does not match with any of the predetermined block sizes! The error occurred in %s at line %d\n", blocksize, __FILE__, __LINE__);
540540
exit(1);
541541
}
542-
}
542+
}
543543
/* Check for kernel launch errors */
544544
CHK_ERR(cudaPeekAtLastError());
545545
/* Synchronize and free the thread data allocation */

arch/gpu_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ struct GPUMemoryManager {
281281
std::cerr << "Error: Pointer name '" << name << "' not found.\n";
282282
return false;
283283
}
284-
284+
285285
if (gpuMemoryPointers[name] != nullptr) {
286286
CHK_ERR( gpuFree(gpuMemoryPointers[name]) );
287287
}

backgroundfield/backgroundfield.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void setBackgroundField(
124124
for(uint fComponent=0;fComponent<3;fComponent++){
125125
T3DFunction valueFunction = std::bind(bgFunction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, (coordinate)fComponent, 0, (coordinate)0);
126126
BgBGrid.get(x,y,z)->at(fsgrids::bgbfield::BGBXVOL+fComponent) += volumeAverage(valueFunction,accuracy,start.data(),end);
127-
127+
128128
//Compute derivatives. Note that we scale by dx[] as the arrays are assumed to contain differences, not true derivatives!
129129
for(uint dComponent=0;dComponent<3;dComponent++){
130130
T3DFunction derivFunction = std::bind(bgFunction, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, (coordinate)fComponent, 1, (coordinate)dComponent);
@@ -158,4 +158,3 @@ void setBackgroundFieldToZero(
158158
}
159159
}
160160
}
161-

backgroundfield/backgroundfield.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ template<long unsigned int numFields> void setPerturbedFieldToZero(
6969
This function is used along with a field function to append the given function values to the
7070
perturbed B grid.
7171
A special other use case is, if using a Magnetosphere with dipole type 4 (vector dipole), when
72-
the corrective terms to vanish the dipole towards the inflow boundary are stored in
72+
the corrective terms to vanish the dipole towards the inflow boundary are stored in
7373
the backgroundfield FSgrid object at offset fsgrids::bgbfield::BGBXVDCORR
7474
*/
7575
template<long unsigned int numFields> void setPerturbedField(
@@ -125,12 +125,11 @@ template<long unsigned int numFields> void setPerturbedField(
125125
dx[faceCoord2[fComponent]]
126126
);
127127

128-
}
129-
// Derivatives or volume averages are not calculated for the perBField
130-
}
128+
}
129+
// Derivatives or volume averages are not calculated for the perBField
130+
}
131131
}
132132
}
133133
}
134134

135135
#endif
136-

backgroundfield/constantfield.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,3 @@ double ConstantField::operator()( double x, double y, double z, coordinate compo
4747
return 0.0;
4848
}
4949
}
50-
51-
52-
53-
54-
55-

backgroundfield/constantfield.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ConstantField {
3434
bool _initialized;
3535
double _B[3]; // constant backgroundfield
3636
public:
37-
37+
3838
ConstantField(){
3939
this->_initialized = false;
4040
}
@@ -44,4 +44,3 @@ class ConstantField {
4444
};
4545

4646
#endif
47-

backgroundfield/dipole.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,40 +42,40 @@ void Dipole::initialize(const double moment,const double center_x, const double
4242

4343

4444
double Dipole::operator()( double x, double y, double z, coordinate component, unsigned int derivative, coordinate dcomponent) const {
45-
const double minimumR=1e-3*physicalconstants::R_E; //The dipole field is defined to be outside of Earth, and units are in meters
45+
const double minimumR=1e-3*physicalconstants::R_E; //The dipole field is defined to be outside of Earth, and units are in meters
4646
if(this->initialized==false) {
4747
return 0.0;
4848
}
4949
double r[3];
50-
50+
5151
r[0]= x-center[0];
5252
r[1]= y-center[1];
5353
r[2]= z-center[2];
54-
54+
5555
double r2 = r[0]*r[0]+r[1]*r[1]+r[2]*r[2];
56-
56+
5757
if(r2<minimumR*minimumR) {
5858
// r2=minimumR*minimumR;
5959
return 0.0; //set zero field inside dipole
6060
}
61-
61+
6262
const double r5 = (r2*r2*sqrt(r2));
6363
const double rdotq=q[0]*r[0] + q[1]*r[1] +q[2]*r[2];
64-
64+
6565
const double B=( 3*r[component]*rdotq-q[component]*r2)/r5;
66-
66+
6767
if(derivative == 0) {
6868
//Value of B
6969
return B;
7070
} else if(derivative == 1) {
71-
//first derivatives
71+
//first derivatives
7272
unsigned int sameComponent;
7373
if(dcomponent==component) {
7474
sameComponent=1;
7575
} else {
7676
sameComponent=0;
7777
}
78-
78+
7979
return -5*B*r[dcomponent]/r2+
8080
(3*q[dcomponent]*r[component] -
8181
2*q[component]*r[dcomponent] +
@@ -84,9 +84,3 @@ double Dipole::operator()( double x, double y, double z, coordinate component, u
8484

8585
return 0; // dummy, but prevents gcc from yelling
8686
}
87-
88-
89-
90-
91-
92-

backgroundfield/dipole.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ class Dipole {
3535
double q[3]; // Dipole moment; set to (0,0,moment)
3636
double center[3]; // Coordinates where the dipole sits; set to (0,0,0)
3737
public:
38-
38+
3939
Dipole() {}
4040

4141
void initialize(const double moment,const double center_x, const double center_y, const double center_z, const double tilt_angle);
4242
double operator()(double x, double y, double z, coordinate component, unsigned int derivative=0, coordinate dcomponent=X) const;
4343
};
4444

4545
#endif
46-

backgroundfield/fieldfunction.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ Background magnetic field class of Vlasiator.
3232

3333
typedef std::function<double(double x, double y, double z, coordinate component, unsigned int derivative, coordinate dcomponent)> FieldFunction;
3434
#endif
35-

backgroundfield/integratefunction.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ double lineAverage(
4747
const double acc = accuracy*L;
4848
const double a = r1[line];
4949
const double b = r1[line] + L;
50-
50+
5151
switch (line) {
5252
case X:
5353
{
@@ -77,7 +77,7 @@ double lineAverage(
7777

7878

7979
double surfaceAverage(
80-
const T3DFunction& f1,
80+
const T3DFunction& f1,
8181
coordinate face, double accuracy,
8282
const double r1[3],
8383
double L1,
@@ -97,7 +97,7 @@ double surfaceAverage(
9797
case Y:
9898
{
9999
T2DFunction f = std::bind(f1,std::placeholders::_1,r1[1],std::placeholders::_2);
100-
value = Romberg(f, r1[0],r1[0]+L1, r1[2],r1[2]+L2, acc)*norm;
100+
value = Romberg(f, r1[0],r1[0]+L1, r1[2],r1[2]+L2, acc)*norm;
101101
}
102102
break;
103103
case Z:
@@ -127,4 +127,3 @@ double volumeAverage(
127127
value= Romberg(f1, r1[0],r2[0], r1[1],r2[1], r1[2],r2[2], acc)*norm;
128128
return value;
129129
}
130-

0 commit comments

Comments
 (0)