Beispiel #1
0
 def test_SIU_single_noderesults(self):
     """Write some node results for whole model with disconnected=False
     """
     data = fs.open_sif(self._in_files['siu_single'])
     nodes = data.get_nodes()
     elements = data.get_elements()
     disp = data.get_noderesults('displacement', rescases=1)
     vtu = fs.utils.VtuWriter(self._out_files['siu_single'])
     vtu.new_piece(nodes, elements)
     vtu.start_pointdata()
     vtu.add_data(disp, 'displacement')
     vtu.close()
     self.assertTrue(os.path.isfile(self._out_files['siu_single']))
Beispiel #2
0
"""

import freesif as fs
import matplotlib.pyplot as plt

# convert data into HDF5 format
#fs.sif2hdf5('../test_files/slowdrift_G1.SIF')

# open the hdf5 file (returns a File object)
#f = fs.open_hdf5('G1.h5')

# access the HydroData object via the dict interface
#d = f['G1']

# alternative short hand method to do above 3 steps in once:
d = fs.open_sif('../tests/files/hydro/slowdrift_G1.SIF')

# get motion data
dirs = d.get_directions('degrees')
periods = d.get_periods()
motions = d.get_motion_raos()

# plot data
resp_names = ['Surge', 'Sway', 'Heave', 'Roll', 'Pitch', 'Yaw']
markers = [
    '.-', 'o-', 'v-', '^-', '<-', '>-', '1-', '2-', '3-', '4-', '8-', 's-',
    'p-', '*-', 'h-', 'H-', '+-', 'x-', 'D-', 'd-', '|-', '_-'
]

fig, axes = plt.subplots(3, 2, figsize=(10, 12), sharex=False)
Beispiel #3
0
 def setUpClass(cls):
     # establish HydroData instances and associated verification data
     cls._data1 = fs.open_sif(
         os.path.join(FILES, 'hydro', 'slowdrift_G1.SIF'))
     cls._data1_verified = np.load(
         os.path.join(FILES, 'hydro', 'slowdrift_G1_verified_arrs.npz'))
Beispiel #4
0
 def setUpClass(cls):
     # establish a closed StrucData instance (single sup. elem.)
     cls._data = fs.open_sif(
         os.path.join(FILES, 'struc', 'single_super_elem',
                      'test01_1stord_linstat_R1.SIU'))
     cls._data.close()
Beispiel #5
0
 def setUpClass(cls):
     # establish a closed HydroData instance
     cls._data = fs.open_sif(
         os.path.join(FILES, 'hydro', 'slowdrift_G1.SIF'))
     cls._data.close()
Beispiel #6
0
 def setUpClass(cls):
     # establish StrucData instances and associated verification data
     cls._data = fs.open_sif(os.path.join(FILES, 'struc', 'single_super_elem', 'test01_1stord_linstat_R1.SIU'))
     cls._f_verified = h5py.File(os.path.join(FILES, 'verified_testdata.h5'), 'r')
     cls._gr_verified = cls._f_verified['test01_1stord_linstat_R1/LD_plates/noderes']