-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
As I mentioned in my comment to #52, the way the CLI version of our code handles the geometry parameters (params['gridA'], ... params['gridN'], lvec, nDim etc.) could use some cleanup. For starters, I propose we discuss this issue:
- What do we expect to be the role of
gridA,gridB,gridC, andgridNparameters in the code? Do we want them to be just an optional input (in case the geometry is not specified by other means, in particular in a*.xsfor other input file)? In such a case, they can be safely forgotten (I do not mean literally deleted, just ignored) after the initialization stage. The actual lattice vectors and grid size should be consistently carried in variables likelvecandnDimthroughout the actual computation. Alternatively, do we wantparms['gridA'], ... params'['gridN']to serve as a global variable? Then, we should consistently work with those. In the most extreme version of this choice, we would not even need to introducelvecandnDimvariables at all. I can somehow understand that a compromise might be desirable: Perhaps we want some functions to be also usable as stand-alone entities, without being called from the main scripts. A moderately experienced user might want to do something in an interactive Python session. TheloadGeometryfunction is one of those we may want to be able to call this way. Then, it makes sense for such a function to takelvec, 'nDim` etc. as arguments and store them as its local variables. On the other hand, some other functions may be intended as mere subprograms of the main executable scripts and need access to global variables, since passing everything they need through arguments to them would be inefficient and would generate too long argument lists. I suspect this compromise was what @ProkopHapala had in mind when originally writing the code. Prokop, is that so? I am actually in favor of the compromise solution, given that we decide very carefully which functions should be the independent entities, taking geometry parameters as their arguments and perhaps returning them as their values, which functions should in contrast access the global variables, and why the chosen option is needed in every case. Because if we are not clear about this, we inevitably end up with the mess we currently have. - As a second point, I would like to make sure that the code reads the origin of the unit cell from the
*.xsfand*.cubefiles every time, stores it and handles accordingly. That is, the code should not rely on the origin being zero. We might even introduce an optional parameterparams['gridOrigin']toparams.ini, which would be used with*.xyzfiles. That should solve the problem with negative coordinates of atoms in non-periodic systems, which is currently effectively forbidden.
Metadata
Metadata
Assignees
Labels
No labels