Closed alecjohnson closed 10 years ago
Hi Alec,
thanks for this. I agree with you. As you thought, the code was written like this in anticipation of using grid in logical space. thanks, stefano.
Modifications have been included in the amaya-library branch at commit: CmPA/iPic3D@5a7a34a4df4eae8384f2a0a86fe10816ef13b4bd
In the
Grid3DCU
class, the implementationcan be replaced with
if in the constructor we replace
and
with
This reduces memory use and the expense of obtaining coordinate positions.
I surmise that
node_coordinate
andcenter_coordinate
were created in anticipation of generalizing to a deformed logically cartesian mesh. The rest of the code, however, does not seem to have been consistently written with this in mind. I therefore do not see the value of retaining this implementation, and I would even consider using the alternative accessorsbased in part on the philosophy that the easiest code to generalize is typically not code that attempts to anticipate generalization but rather code that is clean and simple and readable. For now I will implement these accessors for use in performance-critical parts of the code (pushing particles and summing moments) unless I hear an objection.