Closed lheagy closed 2 years ago
A couple of minor suggestions based on @dccowan's implementation of the sphere in a uniform electrostatic field...
the computation of vector distance is repeated quite a bit and this could be simplified ~replaced by the method geoana.spatial.distance
that does this . e.g. we can replace this with geoana.spatial.distance
~ see @jcapriot's comment below
for the methods that compute fields / fluxes, I would suggest we have separate methods for computing and returning total, primary, and secondary current_density_total
, current_density_primary
, current_density_secondary
. This makes them more discoverable and has the benefit of always providing outputs that are numpy arrays (whereas currently, you could get a numpy array or a list depending on how you call the function). This point is up for discussion and I would appreciate thoughts from @dccowan and @jcapriot
In my opinion there's a lot of redundant functions in that spatial module that are handled with simple operations...
i.e. just call xyz - self.location
instead of defining a function to just subtract two things...
when calling for the distance, just use np.linalg.norm
. My point is, there are already plenty of functions that already do these operations, and it's needless to wrap them.
sounds good
In
geoana/geoana/em/static/sphere.py
we should also include the solution for a permeable sphere in a uniform magnetostatic field. The solution for the magnetic field is in Ward and Hohmann (6.69). The derivation follows the conducting sphere in a uniform electrostatic field.The implementation should include methods to compute: