include initial position A FoR
@@ -442,6 +442,10 @@ class StructuralInformation():
self.lumped_mass_mat_nodes = np.zeros((num_lumped_mass_mat,), dtype=int)
self.lumped_mass_mat = np.zeros((num_lumped_mass_mat, 6, 6), dtype=float)
+ self.orientation = np.array([1., 0., 0., 0.])
+ self.for_pos = np.zeros((6,),)
+
+
def generate_full_structure(self,
num_node_elem,
num_node,
@@ -515,6 +519,10 @@ class StructuralInformation():
self.lumped_mass_mat_nodes = lumped_mass_mat_nodes
self.lumped_mass_mat = lumped_mass_mat
+ self.orientation = np.array([1., 0., 0., 0.])
+ self.for_pos = np.zeros((6,),)
+
+
def generate_1to1_from_vectors(self,
num_node_elem,
num_node,
@@ -551,6 +559,10 @@ class StructuralInformation():
self.lumped_mass_mat_nodes = np.zeros((num_lumped_mass_mat,), dtype=int)
self.lumped_mass_mat = np.zeros((num_lumped_mass_mat, 6, 6), dtype=float)
+ self.orientation = np.array([1., 0., 0., 0.])
+ self.for_pos = np.zeros((6,),)
+
+
def create_frame_of_reference_delta(self, y_BFoR='y_AFoR'):
"""
create_frame_of_reference_delta
@@ -823,6 +835,10 @@ class StructuralInformation():
self.create_frame_of_reference_delta(y_BFoR)
self.boundary_conditions = np.zeros((self.num_node), dtype=int)
+ self.orientation = np.array([1., 0., 0., 0.])
+ self.for_pos = np.zeros((6,),)
+
+
def assembly_structures(self, *args):
"""
assembly_structures
@@ -844,6 +860,12 @@ class StructuralInformation():
total_num_mass = self.mass_db.shape[0]
for structure_to_add in args:
+ # Checks
+ if not (structure_to_add.quat == np.array([1., 0, 0, 0])).all():
+ cout.cout_wrap("ERROR: structures to be assembled shoud not be rotated. Check quaternion", 4)
+ if not (structure_to_add.for_pos[0:3] == np.array([0., 0, 0])).all():
+ cout.cout_wrap("ERROR: structures to be assembled shoud not be displaced. Check for_pos", 4)
+
self.coordinates = np.concatenate((self.coordinates, structure_to_add.coordinates), axis=0)
self.connectivities = np.concatenate((self.connectivities, structure_to_add.connectivities + total_num_node), axis=0)
assert self.num_node_elem == structure_to_add.num_node_elem, "num_node_elem does NOT match"
@@ -961,6 +983,8 @@ class StructuralInformation():
if isinstance(self.lumped_mass_mat_nodes, np.ndarray):
h5file.create_dataset('lumped_mass_mat_nodes', data=self.lumped_mass_mat_nodes)
h5file.create_dataset('lumped_mass_mat', data=self.lumped_mass_mat)
+ h5file.create_dataset('orientation', data=self.orientation)
+ h5file.create_dataset('for_pos', data=self.for_pos)
######################################################################
