j@253: (cl:in-package #:amuse-charm) j@253: j@253: ;;;===================================================================== j@253: ;;; Charm-constituents - experimental implementation j@253: ;;;===================================================================== j@253: j@253: ;;; This aims to bolt on Charm compliance (including database j@253: ;;; versioning) to AMuSE constituents as they are currently implmented j@253: ;;; (i.e. compositions primarily). However, in order to avoid breaking j@253: ;;; existing code, this is not the most tidy of solutions. j@253: j@253: ;;;===================================================================== j@253: ;;; Charm property lists j@253: ;;; j@253: ;;; Many things I don't like about this. Using the class hiererchly j@253: ;;; for these kinds of properties might be nicer. j@253: ;;;===================================================================== j@253: j@253: (defclass charm-property-list (amuse-object list-slot-sequence) ()) j@253: j@253: ;;; Or should the lists themselves be typed? j@253: j@253: ;; (defclass charm-property (amuse-object) () j@253: ;; (:documentation "Base class for charm property objects.")) j@253: j@253: ;; (defclass extrinsic-property (charm-property) j@253: ;; ((property :reader property j@253: ;; :initarg :property j@253: ;; :documentation "String specifiying extrinsic property.")) j@253: ;; (:documentation "Base class for charm extrinsic properties.")) j@253: j@253: ;; (defclass intrinsic-property (charm-property) j@253: ;; ((property :reader property j@253: ;; :initarg :property j@253: ;; :documentation "String describing intrinsic property.")) j@253: ;; (:documentation "Base class for charm intrinsic properties.")) j@253: j@253: j@253: ;;;===================================================================== j@253: ;;; Charm constituent identifier j@253: ;;;===================================================================== j@253: j@253: (defclass charm-constituent-identifier (constituent-identifier) j@253: ((constituent-id :reader constituent-id j@253: :initarg :constituent-id)) j@253: (:documentation "Class to represent Charm constituent identifiers.")) j@253: j@253: j@253: ;;;===================================================================== j@253: ;;; Charm constituents j@253: ;;;===================================================================== j@253: j@253: (defclass charm-constituent (list-slot-sequence anchored-period) j@253: ((identifier :accessor identifier j@253: :initarg :identifier j@253: :initform nil j@253: :documentation "Slot to store the constituent j@253: identifier containing the constituent's database ID, j@253: which is allocated automatically when inserted into the j@253: database.") j@253: ;; (parent-identifier :reader parent-identifier j@253: ;; :initarg :parent-identifier j@253: ;; :documentation "Slot to store the identifer for j@253: ;; the constituent from which the particles of this j@253: ;; constituent are also members. May either be j@253: ;; another Charm constituent or an AMuSE j@253: ;; composition.") j@253: (parent :reader parent j@253: :initarg :parent j@253: :documentation "Slot to store the constituent from which j@253: the particles of this constituent are also members. May j@253: either be another Charm constituent or an AMuSE j@253: composition.") j@253: (extrinsic-properties :reader extrinsic-properties j@253: :initarg :extrinsic-properties j@253: :documentation "Slot for the specification of j@253: extrinsic properties.") j@253: (intrinsic-properties :reader intrinsic-properties j@253: :initarg :intrinsic-properties j@253: :documentation "Slot for the description of j@253: intrinsic properties.") j@253: ;; (particles-cache :accessor particles-cache ;; FIXME: why bother? j@253: ;; :initarg :particles-cache j@253: ;; :initform nil j@253: ;; :documentation "Slot to store the objects j@253: ;; identifier by the particles-identifiers.") j@253: (owner :accessor owner j@253: :initarg :owner j@253: :initform nil) j@253: (version :accessor version j@253: :initarg :version j@253: :initform nil) j@253: (creation-timestamp :accessor creation-timestamp j@253: :initarg :creation-timestamp j@253: :initform nil) j@253: (deletion-timestamp :accessor deletion-timestamp j@253: :initarg :deletion-timestamp j@253: :initform nil)) j@253: (:documentation "Base class for constituents")) j@253: j@253: (defclass standard-charm-constituent (charm-constituent j@253: standard-anchored-period) () j@253: (:documentation "Base class for constituents using standard time j@253: representation.")) j@253: j@253: (defmethod initialize-instance :after ((constituent j@253: standard-charm-constituent) &key) j@253: (amuse::%recompute-standard-composition-period constituent)) j@253: j@253: (defmethod (setf %list-slot-sequence-data) :after (new-value object) j@253: (declare (ignore new-value)) j@253: (amuse::%recompute-standard-composition-period object)) j@253: j@253: (defclass standard-charm-event-constituent (standard-charm-constituent) j@253: () j@253: (:documentation "Base class for constituents using standard time j@253: representation.")) j@255: j@255: (defclass standard-charm-pitched-event-constituent j@255: (standard-charm-event-constituent) j@255: () j@255: (:documentation "Base class for constituents using standard time j@255: representation containing only pitched events.")) j@255: j@255: (defclass standard-charm-unpitched-event-constituent (standard-charm-event-constituent) j@255: () j@255: (:documentation "Base class for constituents using standard time j@255: representation containing only unpitched events."))