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