refactor: Add general Structure class#2420
Open
trisyoungs wants to merge 8 commits intodevelop2from
Open
Conversation
Member
Author
|
I have just realised that a number of functions were declared but not implemented. I'll be moving these over in a follow-up PR. |
RobBuchananCompPhys
requested changes
May 5, 2026
| Atom::Presence Atom::presence() const | ||
| { | ||
| return Z_ == Elements::Phantom ? Presence::Phantom : Presence::Physical; | ||
| ; |
Contributor
There was a problem hiding this comment.
Suggested change
| ; | |
| #include "classes/structure.h" | ||
| #include "classes/species.h" | ||
|
|
||
| Structure::Structure() { box_ = std::make_unique<SingleImageBox>(); } |
Contributor
There was a problem hiding this comment.
This could all go into the initialiser list, in structure.h
Suggested change
| Structure::Structure() { box_ = std::make_unique<SingleImageBox>(); } | |
| Structure::Structure() : box_(std::make_unique<SingleImageBox>()) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With plans in mind for introducing the capability for a
Speciesto be created within a graph from source geometry and forcefield terms, this PR introduces a fairly lightweightStructureclass. It is envisaged that this will be used to store, e.g. data read from XYZ files, data read from CIF files, etc. Since its focus is on utility rather than strictly protected data relationships (as is the case withSpecies) both atoms and bonds are represented as vectors of unique ptrs, rather than trying to emulate the reference-based system inSpecieswhich requires a bunch of copy / move constructor magic to maintain it. Thoughts on this welcome!A little pre-emptive tidying of
Speciesis done along the way to remove some unused stuff.