#1.2 Required input data (loop in order to be able to minimize the code):
##Specification of input data:
##Cross section
D_hydro = 0.4033 #Hydrodynamic pipe diameter
D = 0.4033 #Outer pipe diameter including any coating layer
w_s = 484.76 #Submerged pipe weight per unit length
w_s_i = 484.76 #Submerged pipe weight per unit length, installation condition
w_s_w = 484.76 #Submerged pipe weight per unit length in waterfilled condition
m = 180.74 #Dry pipe mass per unit length
t_mgrt = 0.0 #Marine growth thickness
k_lay_user = 1.0 #User defined lay factor
EI = 0.0 #Pipe bending stiffness
T0 = 0.0 #Lay tension, horizontal component
alpha_m = 0.0 #Damping coeff for mass-proportional rayleigh damping

##Hydro parameters
rho_w = 1028.0 # water density
U_m = 0.0 #Flow velocity amplitude, used for regular waves
T = 0.0 #Regular wave period
U_c = 0.358 #Steady current velocity perpendicular to pipe
Phi_t = 0.0 #Phase displacement of regular wave
FH_m = 0.0 #Horizontal force amplitude, only if horizontal sine force is appliued
depth = 108.0 #water depth [m]
Tsim = 10800 #Simulation length
WaveVelRef_h = 0.20165 #Reference height for generation of wave-induced particle velocity
Hs = 14.3 #Significant wave height for design sea state
Tp = 15.80 # Peak period for design spectrum
SpectrumPeakedness = 3.30 # Peak-enhancement factor for design spectrum
theta_w = 90.0 # Relative angle between pipe and wave heading
n_spreading = 8.0 # Spectral spreading exponent
r_H = 1.0 # Dummy parameter. Set to: 1.0
r_L = 1.0 # Reduction factor on hydrodynamic lift load
HydroModel = 4 # Force model option: 4 - Database force model, 5 - Horizontal sine force
flowtype = 1 # Not in use. Set to: 1
roughness = 2 # Pipe surface roguhness: 1 - Smooth, 2 - Rough, 3 - Very rough (roughness = 3 only applicable for HydroModel = 4)
GenerateRegularWave = 2 # A regular wave signal should be generated: 1 - True, 2 � False
SmoothWaveVelocity = 2 # Wake velocity should be smoothed prior to differentiation: 1 - True, 2 � False. Default value: 2
WaveOrder = 1 # Wave order option: 1 - Linear, 2 - Second order
SpectrumSpecification = 1 # Applicable Wave spectrum: 1 - JONSWAP
numseeds = 5 # Number of random seastates to be analysed
HydrodynamicDiameter_int = 2 # Option for specifying user defined hydrodynamic diameter: 1 � True, 2 � False
IncludeLiftReduction_int = 2 # Option for including reduction factor on hydrodynamic lift: 1 � True, 2 � False

##Seeds
seedArray_phase = np.require(np.array([81663, 2142, 56225, 24849, 29681]), dtype=np.int32, requirements=['C'])
seedArray_crest = np.require(np.array([36657, 36657, 36657, 36657, 36657]), dtype=np.int32, requirements=['C'])

##Soil variables:
k_soil = 65000.0 # Elastic stiffness of the soil. Recommended value is 65000 N/m/m
mu = 0.6 # Friction coefficient. Specified by user for Coulomb friction. Set to 0.6 for sand and 0.2 for clay
gamma_mark = 10212.0 # Submerged (effective) unit weight of soil
rho_su = 0.0 # Depth gradient of undrained shear strength. Only used for SAFEBUCK and Geotechnical clay models
Nc = 0.0 # Bearing capacity factor for clay. Only used for initial penetration according to the Geotechnical clay model
su_z0 = 0.0 # Undrained shear strength of soil at seabed (z = 0). Only used for SAFEBUCK and Geotechnical clay models
delta_mobilization = 0.0 # Mobilization distance required to reach failure at the relevant penetration depth. Expressed as fraction of the pipe-soil contact width B, which is calculated by the program. Only used for initial penetration calculations according to the SAFEBUCK and Geotechnical clay models
St = 1.0 # Sensitivity (ratio of intact to remoulded shear strength). Only used for SAFEBUCK and Geotechnical clay models when remoulded soil is considered
alpha_soil = 0.02 # Damping coefficient for soil damping in elastic regime (c_soil = alpha_soil * k_soil)
su_sigmav_NC = 0.0 # Ratio of the normally consolidated shear resistance to the consolidation normal stress. Typical range is between 0.25 and 0.5. Only used for Geotechnical clay model
alpha_brk = 0.0 # Pipe-soil adhesion factor. Only used for Geotechnical clay model
gamma_pre = 0.0 # Consolidation preloading effect. Taken as the ratio of preloading (e.g. waterfilled submerged weight) to the submerged weight in the condition considered. Only used for Geotechnical clay model
m_OCR = 0.0 # Exponent accounting for long-term effect of overconsolidation. Only used for Geotechnical clay model
kappa_active = 0.0 # Active earth pressure coefficient. A value of 2 is recommended to account for inclined loading (horizontal + lift). Only used for Geotechnical clay model when suction is included
kappa_passive = 0.0 # Passive earth pressure coefficient. A value of 2 is recommended to account for inclined loading (horizontal + lift). Only used for Geotechnical clay model
su_active = 0.0 # Average undrained shear strength within the active failure zone. Only used for Geotechnical clay model when suction is included
su_passive = 0.0 # Average undrained shear strength within the passive failure zone. Only used for Geotechnical clay model
gamma_total = 0.0 # Total unit soil weight in air. Only used for clay (in Verley and Lund model and after break-out in the other models). Verley and Lund recommend a value of 18000 N/m3 regardless of the value of submerged unit weight.
su = 0.0 # Undrained shear strength of soil. Only used for Verley and Lund clay model
z_ini_user = 0.0 # User defined initial penetration
z_t = 0.0 # Trench depth
theta_t = 0.0 # Trench-wall angle
SoilModel = 2 # Soil model option: 1 - Coulomb friction, 2 - Pipe-sand, 3 - Pipe-clay
CalculatedLayFactor_int = 2 # Option for including a lay factor calculated by PILSS to increase static contact pressure for initial penetration calculation. 1 - True, 2 � False
UserDefinedLayFactor_int = 2 # Option for including a user defined lay factor to increase static contact pressure for initial penetration calculation. 1 � True, 2 � False
InitialPenetrationModel = 1 # Penetration calculation model option for pipe-clay: 1 - Verley and Lund (1995), 2 - SAFEBUCK, 3 - Geotechnical model
remoulded_int =  2 # Option for reducing shear strength due to remoulded soil (used for the combination SoilModel = 3 and InitialPenetrationModel = 2 or 3). 1 - True, 2 � False
suction_int = 2 # Option to account for clay suction: 1 - True, 2 � False
waterFilled_int = 2 # Option to account for weight of water-filled pipe when calculating initial penetration: 1 � True, 2 - False
UserDefinedInitialPenetration_int = 2 # Option to include user defined initial penetration: 1 � True, 2 - False
IncludeTrench_int = 2 # Option to include reduction factors on hydrodynamic loads due to trench. 1 � True, 2 - False

##Time series variables:
t_start = 0.0 # Start time for dynamic analysis. Set to: 0.0
delta_t = 0.01 # Timestep for dynamic analysis. Typical timestep size is 0.001s
delta_t_signal = 0.35 # Timestep for wave-induced particle velocity signal. Recommended value is 0.35 s. Cannot be less than delta t
delta_t_res = 1.0 # Resolution of results vectors used for plots and writing results to file.
delta_t_plot = 1.0 # Resolution of plot vectors


##Dynamic solution variables:
RampUpPeriod = 0.0 # Duration of ramp-up period. Hydrodynamic loads increase linearly from zero to full strength during ramp-up period. Recommended duration is approximately 20% of the storm duration, or 2000 s for a three-hour storm
MaxNrOfIterations = 10 # Maximum number of equilibrium iterations in each timestep
RampUp_int = 2 # Set to 1 if storm ramp up introduces a linear reduction to hydrodynamic loads for the ramp-up period: 1 � True, 2 � False

##Optionals 
printToFile = 3 # 1 - Print all results to .txt file, 2 - Do not print results to file, 3 - Only print ResultsOverview to file
readWaveVelFromFile = 2
generatePlots = False
ExplicitAcceleration = True