Sometimes I do things right, then I change them thinking my old self was
an idiot and then they break.
The positive point: the solutions end up being better.
I don't belive it, this was the largest change in the code ever made and
it is compiling now.
Now, I have to test, clean the code, change the examples and update the
documentation...
I need to make a common module for mesh, many functions for elements are
shared.
Also, try to reduce the 'select type' statements, but I don't know
enough Fortran for it.
It is now complete and working. I also added some minor improvements to moduleMesh.f90 using 'associate' to practice.
I noticed there are a lot of things (allocating K, for example) that are common for all meshes and should be moved to a general module.
I was almost sure this was implemented in the past, but it was not working.
Now, if n = 0 or if n is not provided, particles are injected with the normal to the surface.
So it seems that rectangles and triangles are now working properly.
I have also checked the phy2log routine, now it seems a bit more complicated, but it is much clearer.
Maybe in the future is worth rethinking to improve speed (specially for quad elements)
Now they give the right electric field.
I have to change 2DCyl.
However, there was some insonsistency between the change of coordinates in phy2log and the Jacobian for the K matrix. I fixed it putting a transpose() in phy2log, but I don't like that solution.
I need to review the basic procedure of phy2log.
After reading some works and reviewing what I had, I've done some
corrections to how the randomb velicities in Maxwellian distributions
are calculated. These should be correct now.