Open psychocoderHPC opened 9 years ago
What is a SumCurrentChange
?
I thought this plugin just adds up J
which is a SumCurrentDensity
.
Might be my suggested name is not good, but is it not the change of J
Hm, from checking the source on my cell phone, it looks like a simple globsl reduce of fieldJ:
That means the current name "SumCurrent" (or what I proposed "SumCurrentDensity" to be more precise but dbl check factor for that) is valid ;)
You are right but our FieldJ
is not the current, it's the change of the current in one time step. Is it right? Maybe I am wrong.
Close. Our FieldJ
(as I documented inline long time ago in it's header file) is a current density which is the change of the charge over time and divided by the area it went through :) (See Ampère's circuital law in the Maxwell's equations.)
That's why I proposed to either call it "SumCurrentDensity" or to multiply it with the cell Volume (if it isn't already) - which makes it a "SumCurrent".
Update: I just opened my laptop and checked the sources. Since the result of the currentDensity
-sum of FieldJ
is multiplied with the area of the cell plane normal to the component, the current name is absolutely valid. I took the freedom to update your description.
I think adding a MPI_Reduce
is already sufficient, so only rank 0
creates output.
Of course, we can also use the libPMacc
reduce to reduce the code further.
OK that's fine, than there is only the refactor part open. :+1:
the plugininvalid request, the current name is absolutely correct since the result is multiplied with the according area of the cell-plane facing it (ax3l)SumCurrents
is wrong named and should be calledSumCurrentChange
MPI_Reduce
(orlibPMacc
's version of it) and write only from one rank (in a text file) (ax3l)