Commit 2839d405 authored by MischaD's avatar MischaD
Browse files

Added shell

parent 1a9d5134
import numpy as np
from .utils.mylog import logger
class Shell:
def __init__(self, velocities):
self._weight = None
self._c_s_sq = None = abs(velocities[0]**2).sum()
self.type = tuple(np.sort(abs(velocities[0])))
self.size = len(velocities)
self.velocities = velocities
def __repr__(self):
repr_string = "Shell: {} - Type: {} - Amount of velocities: {}".format(, self.type, self.size)
if self._weight is not None:
repr_string += " - Weight: {}".format(self.weight)
return repr_string
def weight(self):
if self._weight is None:
logger.warning("Weight of shell uninitialized. Calculate it first")
return self._weight
def set_weight(self, c_s_sq, weight):
self._c_s_sq = c_s_sq
self._weight = weight
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment