// Complete journal file generating a 4 legged jacket with one loadcase - gravity
// The model is described in a separate workshop document
// Different from other jacket tutorials, this has been build up using help planes 
// and split structure and not by use of guiding planes. The reason for such is to learn
// the user that both options can be used.
//
// The model includes supernodes for connection to a barge
//
// When creating the mesh set superelement type to number 2 in Edit|Rules|Mesh
// Create the mesh by e.g. ALT+M before export using Export FEM under Tools|Analysis
//
// If Genie shall be run in batch, remember to manually include the following (which is
// included at end of this file):
// SimplifyTopology(); and CreateMesh(); and ExportMeshFem().DoExport("T2.FEM");
//
// If analysing this structure only, remove the boundary conditions and insert new ones 
// at e.g. the bottom of the main legs.
//
// 
// A separate description of this workshop exist - all page references herein is to the same
// workshop document
//
// UNITS: Consistent set of units - tonnes, kiloNewton, Metres
//
// The model has been created by using Genie v2.4-01

//
// *************************************************************
// PART 1: Specify databse units
// *************************************************************
//
//
// Copyright: DNV Software
// Prepared by: Ole Jan Nekstad
// Last updated 28 Oct, 2003
//
GenieRules.Units.setDatabaseUnits("m","kN","delC");
GenieRules.Units.setInputUnit(Length,"m");
GenieRules.Units.setInputUnit(Force,"kN");
GenieRules.Units.setInputUnit(TempDiff,"delC");
//
// *************************************************************
// PART 2: Define the Design Premise
// *************************************************************
//
// Cross section library
// Metres
//
Pipe1 = PipeSection(0.50799m, 0.0127m); 
Pipe2 = PipeSection(0.6096m, 0.01588m);
Pipe3 = PipeSection(0.4064m, 0.0127m);
Pipe4 = PipeSection(0.6096m, 0.0254m);
Pipe5 = PipeSection(0.762m, 0.0254m);
Pipe6 = PipeSection(0.700m, 0.025m);
Pipe7 = PipeSection(0.69999m, 0.015m);
Pipe8 = PipeSection(0.60959m, 0.01905m);
Pipe9 = PipeSection(0.508m, 0.01588m);
Pipe10 = PipeSection(1.6099m, 0.020m);
Pipe11 = PipeSection(0.6096m, 0.0127m);
Pipe12 = PipeSection(0.3238m, 0.0127m);
Pipe13 = PipeSection(0.800m, 0.020m);
Pipe14 = PipeSection(1.000m, 0.025m);
Pipe15 = PipeSection(1.200m, 0.030m);
Pipe16 = PipeSection(1.680m, 0.055m);
Pipe17 = PipeSection(1.59999m, 0.015m);
Pipe18 = PipeSection(1.200m, 0.040m);
//
// Material library
// Units tonne, kiloNewton, Metres, yield = 3.45E05Pa
//
Mat1 = Material(345000KPa, 8.25tonne/m^3, 206010000KPa, 0.3, 1.2E-5 delC^-1, 0 N*s/m);
//
//
//
// Setting defaults before modelling starts
//
Pipe17.setdefault();
Mat1.setdefault();
//
//
// Setting the mesh rules right
//
GenieRules.Meshing.autoSimplifyTopology(true);
GenieRules.Meshing.superElementType(1);
//
//
// *************************************************************
// PART 3: Modelling the main legs and conductors
// *************************************************************
//
// For this workshop no guideplanes are used
// Active use of help planes and split structure is instead used
//
// The legs outer points are defined as points so that reference point modelling
// can be used from this point forward. If so, remember to set this switch
//
// By purpose some of the coordinates have been modelled with units and some not
// to show that it is not necesary to model with units as long as they are the same as the
// actiev user input units
//
Point1 = Point(-16.5m,-16m,0m);
Point2 = Point(1650cm,-16000mm,0m);
Point3 = Point(16.5m,16m,0m);
Point4 = Point(-16.5m,16m,0m);
Point5 = Point(-5,-4.5,95);
Point6 = Point(5,-4.5,95);
Point7 = Point(5,4.5,95);
Point8 = Point(-5,4.5,95);
//
//
// Define the 4 main legs spanning from elevation 0m to 95m
//*********************************************************
//
// The legs have different section properties along it, this will be changed later
//
Bm1 = Beam(Point(-16.5 m,-16 m,0 m),Point(-5 m,-4.5 m,95 m));
Bm2 = Beam(Point(16.5 m,-16 m,0 m),Point(5 m,-4.5 m,95 m));
Bm3 = Beam(Point(16.5 m,16 m,0 m),Point(5 m,4.5 m,95 m));
Bm4 = Beam(Point(-16.5 m,16 m,0 m),Point(-5 m,4.5 m,95 m));
//
// By using reference point modelling the following would be the case:
// Bm1 = Beam(Point1, Point5);
// Bm2 = Beam(Point2, Point6);
// Bm3 = Beam(Point3, Point7);
// Bm4 = Beam(Point4, Point8);
//
//
// Define the 4 conductors
//*************************
// (These can be modelled at any time, but they will be nice to have now when creating
// the conductor frames)
//
Pipe5.setDefault();
Cond1 = Beam(Point(0.862m,-3m,0m),Point(0.862m,-3m,97.5m));
Cond2 = Beam(Point(3.3m,-3m,0m),Point(3.3m,-3m,97.5m));
Cond3 = Beam(Point(3.3m,-0.562m,0m),Point(3.3m,-0.562m,97.5m));
Cond4 = Beam(Point(0.862m,-0.562m,0m),Point(0.862m,-0.562m,97.5m));
//
// *************************************************************
// PART 4: Making the outer parts of elevations
// *************************************************************
//
// Elevation 2.5m
Pipe2.setDefault();
Bm5 = Beam(Point(-16.19736842 m,-15.69736842 m,2.5 m),Point(16.19736842 m,-15.69736842 m,2.5 m));
Bm6 = Beam(Point(16.19736842 m,-15.69736842 m,2.5 m),Point(16.19736842 m,15.69736842 m,2.5 m));
Bm7 = Beam(Point(16.19736842 m,15.69736842 m,2.5 m),Point(-16.19736842 m,15.69736842 m,2.5 m));
Bm8 = Beam(Point(-16.19736842 m,-15.69736842 m,2.5 m),Point(-16.19736842 m,15.69736842 m,2.5 m));
//
// Elevation 30m
Pipe2.setDefault();
Bm9 = Beam(Point(-12.86842105 m,-12.36842105 m,30 m),Point(12.86842105 m,-12.36842105 m,30 m));
Bm10 = Beam(Point(12.86842105 m,-12.36842105 m,30 m),Point(12.86842105 m,12.36842105 m,30 m));
Bm11 = Beam(Point(12.86842105 m,12.36842105 m,30 m),Point(-12.86842105 m,12.36842105 m,30 m));
Bm12 = Beam(Point(-12.86842105 m,12.36842105 m,30 m),Point(-12.86842105 m,-12.36842105 m,30 m));
//
// Elevation 54m
Pipe9.setDefault();
Bm13 = Beam(Point(-9.963157895 m,-9.463157895 m,54 m),Point(9.963157895 m,-9.463157895 m,54 m));
Bm14 = Beam(Point(9.963157895 m,-9.463157895 m,54 m),Point(9.963157895 m,9.463157895 m,54 m));
Bm15 = Beam(Point(9.963157895 m,9.463157895 m,54 m),Point(-9.963157895 m,9.463157895 m,54 m));
Bm16 = Beam(Point(-9.963157895 m,9.463157895 m,54 m),Point(-9.963157895 m,-9.463157895 m,54 m));
//
// Elevation 75m
// Note that Bm20 extends 1.2 m outside the legs on both sides
Pipe13.setDefault();
Bm17 = Beam(Point(-7.421052632 m,-6.921052632 m,75 m),Point(7.421052632 m,-6.921052632 m,75 m));
Bm18 = Beam(Point(7.421052632 m,-6.921052632 m,75 m),Point(7.421052632 m,6.921052632 m,75 m));
Bm19 = Beam(Point(7.421052632 m,6.921052632 m,75 m),Point(-7.421052632 m,6.921052632 m,75 m));
Bm20 = Beam(Point(-7.421052632 m,6.921052632 m,75 m),Point(-7.421052632 m,-6.921052632 m,75 m));
Bm20.moveEnd(2,Vector3d(0m,-1.2m,0m));
Bm20.moveEnd(1,Vector3d(0m,1.2m,0m));
//
// Elevation 93m
Pipe3.setDefault();
Bm21 = Beam(Point(-5.242105263 m,-4.742105263 m,93 m),Point(5.242105263 m,-4.742105263 m,93 m));
Bm22 = Beam(Point(5.242105263 m,-4.742105263 m,93 m),Point(5.242105263 m,4.742105263 m,93 m));
Bm23 = Beam(Point(5.242105263 m,4.742105263 m,93 m),Point(-5.242105263 m,4.742105263 m,93 m));
Bm24 = Beam(Point(-5.242105263 m,4.742105263 m,93 m),Point(-5.242105263 m,-4.742105263 m,93 m));
//
//
// *************************************************************
// PART 5: Make the outer x-braces
// *************************************************************
//
// Between elevation 2.5m and 30m
// All beams inserted by snapping to existing points
Pipe7.setDefault();
Bm25 = Beam(Point(-16.19736842 m,-15.69736842 m,2.5 m),Point(12.86842105 m,-12.36842105 m,30 m));
Bm26 = Beam(Point(16.19736842 m,-15.69736842 m,2.5 m),Point(-12.86842105 m,-12.36842105 m,30 m));
Bm27 = Beam(Point(16.19736842 m,-15.69736842 m,2.5 m),Point(12.86842105 m,12.36842105 m,30 m));
Bm28 = Beam(Point(16.19736842 m,15.69736842 m,2.5 m),Point(12.86842105 m,-12.36842105 m,30 m));
Bm29 = Beam(Point(16.19736842 m,15.69736842 m,2.5 m),Point(-12.86842105 m,12.36842105 m,30 m));
Bm30 = Beam(Point(-16.19736842 m,15.69736842 m,2.5 m),Point(12.86842105 m,12.36842105 m,30 m));
Bm31 = Beam(Point(-16.19736842 m,15.69736842 m,2.5 m),Point(-12.86842105 m,-12.36842105 m,30 m));
Bm32 = Beam(Point(-16.19736842 m,-15.69736842 m,2.5 m),Point(-12.86842105 m,12.36842105 m,30 m));
//
// Between elevation 30m and 54m
Pipe2.setDefault();
Bm33 = Beam(Point(-12.86842105 m,-12.36842105 m,30 m),Point(9.963157895 m,-9.463157895 m,54 m));
Bm34 = Beam(Point(12.86842105 m,-12.36842105 m,30 m),Point(-9.963157895 m,-9.463157895 m,54 m));
Bm35 = Beam(Point(12.86842105 m,-12.36842105 m,30 m),Point(9.963157895 m,9.463157895 m,54 m));
Bm36 = Beam(Point(12.86842105 m,12.36842105 m,30 m),Point(9.963157895 m,-9.463157895 m,54 m));
//
// Note - a 3 point position copy has been performed to illustrate the power of such
//
Bm37 = Bm35.copy3Point(Point(-12.86842105 m,-12.36842105 m,30 m),Point(12.86842105 m,-12.36842105 m,30 m),Point(-9.963157895 m,-9.463157895 m,54 m),Point(12.86842105 m,12.36842105 m,30 m),Point(-12.86842105 m,12.36842105 m,30 m),Point(9.963157895 m,9.463157895 m,54 m));
Bm38 = Bm34.copy3Point(Point(-12.86842105 m,-12.36842105 m,30 m),Point(12.86842105 m,-12.36842105 m,30 m),Point(-9.963157895 m,-9.463157895 m,54 m),Point(12.86842105 m,12.36842105 m,30 m),Point(-12.86842105 m,12.36842105 m,30 m),Point(9.963157895 m,9.463157895 m,54 m));
Bm39 = Bm33.copy3Point(Point(-12.86842105 m,-12.36842105 m,30 m),Point(12.86842105 m,-12.36842105 m,30 m),Point(-9.963157895 m,-9.463157895 m,54 m),Point(12.86842105 m,12.36842105 m,30 m),Point(-12.86842105 m,12.36842105 m,30 m),Point(9.963157895 m,9.463157895 m,54 m));
Bm40 = Bm36.copy3Point(Point(-12.86842105 m,-12.36842105 m,30 m),Point(12.86842105 m,-12.36842105 m,30 m),Point(-9.963157895 m,-9.463157895 m,54 m),Point(12.86842105 m,12.36842105 m,30 m),Point(-12.86842105 m,12.36842105 m,30 m),Point(9.963157895 m,9.463157895 m,54 m));
//
// Between elevation 54m and 75m
Pipe2.setDefault();
Bm41 = Beam(Point(-9.963157895 m,-9.463157895 m,54 m),Point(7.421052632 m,-6.921052632 m,75 m));
Bm42 = Beam(Point(9.963157895 m,-9.463157895 m,54 m),Point(-7.421052632 m,-6.921052632 m,75 m));
Bm43 = Beam(Point(9.963157895 m,-9.463157895 m,54 m),Point(7.421052632 m,6.921052632 m,75 m));
Bm44 = Beam(Point(9.963157895 m,9.463157895 m,54 m),Point(7.421052632 m,-6.921052632 m,75 m));
//
// As an alternative to the 3-point position for this jacket, the beams in the same frames 
// may be copied by a 180 rotation
//
Bm45 = Bm43.copyRotate(Point(0m,0m,0m),Vector3d(0m,0m,1m),180);
Bm46 = Bm42.copyRotate(Point(0m,0m,0m),Vector3d(0m,0m,1m),180);
Bm47 = Bm41.copyRotate(Point(0m,0m,0m),Vector3d(0m,0m,1m),180);
Bm48 = Bm44.copyRotate(Point(0m,0m,0m),Vector3d(0m,0m,1m),180);
//
// Between elevation 75m and 93m
Pipe8.setDefault();
Bm49 = Beam(Point(-7.421052632 m,-6.921052632 m,75 m),Point(5.242105263 m,-4.742105263 m,93 m));
Bm50 = Beam(Point(7.421052632 m,-6.921052632 m,75 m),Point(-5.242105263 m,-4.742105263 m,93 m));
Bm51 = Beam(Point(7.421052632 m,-6.921052632 m,75 m),Point(5.242105263 m,4.742105263 m,93 m));
Bm52 = Beam(Point(7.421052632 m,6.921052632 m,75 m),Point(5.242105263 m,-4.742105263 m,93 m));
//
// Finally, a mirror copy is done by selecting Bm53 and Bm54 and mirror in y-plane
// Similarly, Bm55 and Bm56 are nirrore in x-planse
//
Bm53 = Bm50.copyMirror(Point(0m,0m,0m),Vector3d(0,1m,0));
Bm54 = Bm49.copyMirror(Point(0m,0m,0m),Vector3d(0,1m,0));
Bm55 = Bm51.copyMirror(Point(0m,0m,0m),Vector3d(-1m,0m,0m));
Bm56 = Bm52.copyMirror(Point(0m,0m,0m),Vector3d(-1m,0m,0m));
//
// Making the structure at elevation where first x-braces meet, z=17.881m
//
// Easiest way is to use the help plane and insert beams
// Note that the beam Bm57 extends outside the jacket legs axis 1.2m, it is thus necessary to move
// the beam ends
//
Pipe15.setDefault();
Bm57 = Beam(Point(-14.33546771 m,-13.83546771 m,17.88091889 m),Point(-14.33546771 m,13.83546771 m,17.88091889 m));
Pipe14.setDefault();
Bm58 = Beam(Point(-14.33546771 m,-13.83546771 m,17.88091889 m),Point(0 m,-13.84226013 m,17.82480761 m));
Bm59 = Beam(Point(-14.33546771 m,13.83546771 m,17.88091889 m),Point(0 m,13.84226013 m,17.82480761 m));
Bm57.moveEnd(2,Vector3d(0m,1.2m,0m));
Bm57.moveEnd(1,Vector3d(0m,-1.2m,0m));
//
//
// *************************************************************
// PART 6: Make the horizontal planes
// *************************************************************
//
//
// 1. Create the middle member in y-direction at x-plane at 2.081 for all elevations 
// except for top elevation where x-plane is at 0m
// This is best acheieved by using a help plane and use the x-plane
//
Pipe2.setDefault();
Bm60 = Beam(Point(2.081 m,15.69736842 m,2.5 m),Point(2.081 m,-15.69736842 m,2.5 m));
Pipe11.setDefault();
Bm61 = Beam(Point(2.081 m,12.36842105 m,30 m),Point(2.081 m,-12.36842105 m,30 m));
Pipe3.setDefault();
Bm62 = Beam(Point(2.081 m,9.463157895 m,54 m),Point(2.081 m,-9.463157895 m,54 m));
Bm63 = Beam(Point(2.081 m,6.921052632 m,75 m),Point(2.081 m,-6.921052632 m,75 m));
Bm64 = Beam(Point(0 m,4.742105263 m,93 m),Point(0 m,-4.742105263 m,93 m));
//
// Finalise level 2.5m
//***********************
//
// The beam in x-direction lie in plane y =0.25m
// Use help plane to find snap points
//
Pipe2.setDefault();
Bm65 = Beam(Point(-16.19736842 m,0.25 m,2.5 m),Point(2.081 m,15.69736842 m,2.5 m));
Bm66 = Beam(Point(-16.19736842 m,0.25 m,2.5 m),Point(2.081 m,-15.69736842 m,2.5 m));
Pipe3.setDefault();
Bm67 = Beam(Point(-16.19736842 m,0.25 m,2.5 m),Point(2.081 m,0.25 m,2.5 m));
//
// The support points to the barge connection lies at y-planes 6.921m and -6.921m
// These are best found and snapped to be the help plane (use y-plane)
Pipe4.setDefault();
Bm68 = Beam(Point(16.19736842 m,6.921 m,2.5 m),Point(2.081 m,15.69736842 m,2.5 m));
Bm69 = Beam(Point(16.19736842 m,-6.921 m,2.5 m),Point(2.081 m,-15.69736842 m,2.5 m));
//
// The connection between support points and the midle beam ends up at the middle beam
// at y-planes 6.45m and -6.45m. Use the Help Plane to find snap points
//
Pipe1.setDefault();
Bm70 = Beam(Point(2.081 m,-6.45 m,2.5 m),Point(16.19736842 m,-6.921 m,2.5 m));
Bm71 = Beam(Point(2.081 m,6.45 m,2.5 m),Point(16.19736842 m,6.921 m,2.5 m));
Bm72 = Beam(Point(2.081 m,6.45 m,2.5 m),Point(16.19736842 m,-6.921 m,2.5 m));
//
// The final major beam at this elevation is perpendicular to the inclined beam. Use 
// feature perpendicular beam to model it.
//
Bm73 = Beam(Point(2.081 m,-6.45 m,2.5 m),Point(8.521521358 m,0.3495491962 m,2.5 m));
//
// The conductor supports in x direction lie at y-planes -1.75m and -4.25 m
// Use help planes to find snap points (use y-planes)
//
Bm74 = Beam(Point(2.081 m,-1.75 m,2.5 m),Point(6.532831954 m,-1.75 m,2.5 m));
Bm75 = Beam(Point(2.081 m,-4.75 m,2.5 m),Point(3.69123709 m,-4.75 m,2.5 m));
//
// Finally connect the conductor with the conductor frames
//
Bm76 = Beam(Point(2.081 m,-1.75 m,2.5 m),Point(3.3 m,-0.562 m,2.5 m));
Bm77 = Beam(Point(3.69123709 m,-4.75 m,2.5 m),Point(3.3 m,-3 m,2.5 m));
Bm78 = Beam(Point(2.081 m,-4.75 m,2.5 m),Point(0.862 m,-3 m,2.5 m));
Bm79 = Beam(Point(2.081 m,0.25 m,2.5 m),Point(0.862 m,-0.562 m,2.5 m));
//
// Finalise level 30m
//***********************
//
// The beam in x-direction lie in plane y =0.25m
// Use help plane to find snap points
Pipe9.setDefault();
Bm84 = Beam(Point(-12.86842105 m,0.25 m,30 m),Point(2.081 m,12.36842105 m,30 m));
Bm85 = Beam(Point(-12.86842105 m,0.25 m,30 m),Point(2.081 m,-12.36842105 m,30 m));
Pipe3.setDefault();
Bm86 = Beam(Point(-12.86842105 m,0.25 m,30 m),Point(2.081 m,0.25 m,30 m));
//
// On the opposite side the y-plane is at y=0m
// use help plane to find points
Pipe2.setDefault();
Bm87 = Beam(Point(12.86842105 m,0 m,30 m),Point(2.081 m,12.36842105 m,30 m));
Bm88 = Beam(Point(12.86842105 m,0 m,30 m),Point(2.081 m,-12.36842105 m,30 m));
//
// The supports lie at y=6.921 and y=-6.921
// Use help plane and use y-plane
Pipe8.setDefault();
Bm89 = Beam(Point(6.832101557 m,6.921 m,30 m),Point(12.86842105 m,6.921 m,30 m));
Bm90 = Beam(Point(6.832101557 m,-6.921 m,30 m),Point(12.86842105 m,-6.921 m,30 m));
Pipe9.setDefault();
Bm91 = Beam(Point(6.832101557 m,6.921 m,30 m),Point(12.86842105 m,12.36842105 m,30 m));
Bm92 = Beam(Point(6.832101557 m,-6.921 m,30 m),Point(12.86842105 m,-12.36842105 m,30 m));
//
// The conductor supports in x direction lie at y-planes -1.75m and -4.25 m
// Use help planes to find snap points (use y-planes)
//
Pipe1.setDefault();
Bm93 = Beam(Point(2.081 m,-1.75 m,30 m),Point(11.34211573 m,-1.75 m,30 m));
Bm94 = Beam(Point(2.081 m,-4.75 m,30 m),Point(8.725592327 m,-4.75 m,30 m));
//
// Finally connect the conductor with the conductor frames
//
Pipe12.setDefault();
Bm95 = Beam(Point(0.862 m,-3 m,30 m),Point(2.081 m,-3 m,30 m));
Bm96 = Beam(Point(0.862 m,-0.562 m,30 m),Point(2.081 m,-0.562 m,30 m));
Bm97 = Beam(Point(2.081 m,-0.562 m,30 m),Point(3.3 m,-0.562 m,30 m));
//
// Finalise level 54m
//***********************
//
// The beam in x-direction lie in plane y =0.0m
// Use help plane to find snap points
Pipe3.setDefault();
Bm98 = Beam(Point(-9.963157895 m,0 m,54 m),Point(2.081 m,9.463157895 m,54 m));
Bm99 = Beam(Point(-9.963157895 m,0 m,54 m),Point(2.081 m,-9.463157895 m,54 m));
//
// Opposite side y=0.25m
// Use helpplane y=0.25 to find snap points
Bm100 = Beam(Point(2.081 m,0.25 m,54 m),Point(9.963157895 m,0.25 m,54 m));
Bm101 = Beam(Point(2.081 m,9.463157895 m,54 m),Point(9.963157895 m,0.25 m,54 m));
Bm102 = Beam(Point(2.081 m,-9.463157895 m,54 m),Point(9.963157895 m,0.25 m,54 m));
//
// Connect to conductors
//
Pipe12.setDefault();
Bm103 = Beam(Point(0.862 m,-3 m,54 m),Point(2.081 m,-3 m,54 m));
Bm104 = Beam(Point(3.3 m,-3 m,54 m),Point(2.081 m,-3 m,54 m));
Bm105 = Beam(Point(0.862 m,-0.562 m,54 m),Point(2.081 m,-0.562 m,54 m));
Bm106 = Beam(Point(3.3 m,-0.562 m,54 m),Point(2.081 m,-0.562 m,54 m));
//
// Finalise level 75m
//***********************
//
// The beam in x-direction lie in plane y =0.0m
// Use help plane to find snap points
Pipe3.setDefault();
Bm107 = Beam(Point(-7.421052632 m,0 m,75 m),Point(2.081 m,6.921052632 m,75 m));
Bm108 = Beam(Point(-7.421052632 m,0 m,75 m),Point(2.081 m,-6.921052632 m,75 m));
//
// Opposite side y=0.25m
// Use helpplane y=0.25 to find snap points
Bm109 = Beam(Point(7.421052632 m,0.25 m,75 m),Point(2.081 m,0.25 m,75 m));
Bm110 = Beam(Point(7.421052632 m,0.25 m,75 m),Point(2.081 m,6.921052632 m,75 m));
Bm111 = Beam(Point(7.421052632 m,0.25 m,75 m),Point(2.081 m,-6.921052632 m,75 m));
//
// Connect to conductors
//
Pipe12.setDefault();
Bm112 = Beam(Point(0.862 m,-3 m,75 m),Point(2.081 m,-3 m,75 m));
Bm113 = Beam(Point(2.081 m,-3 m,75 m),Point(3.3 m,-3 m,75 m));
Bm114 = Beam(Point(0.862 m,-0.562 m,75 m),Point(2.081 m,-0.562 m,75 m));
Bm115 = Beam(Point(2.081 m,-0.562 m,75 m),Point(3.3 m,-0.562 m,75 m));
//
// Finalise level 93m
//***********************
//
// The beam in x-direction (both sides) lie in plane y =0.0m
// Use help plane to find snap points
Pipe3.setDefault();
Bm116 = Beam(Point(-5.242105263 m,0 m,93 m),Point(0 m,4.742105263 m,93 m));
Bm117 = Beam(Point(-5.242105263 m,0 m,93 m),Point(0 m,-4.742105263 m,93 m));
Bm118 = Beam(Point(5.242105263 m,0 m,93 m),Point(0 m,4.742105263 m,93 m));
Bm119 = Beam(Point(5.242105263 m,0 m,93 m),Point(0 m,-4.742105263 m,93 m));
//
// Connect to conductors
//
// They are all perpendicular to the nearest beam, use snap perpendicular to do it
//
Pipe12.setDefault();
Bm120 = Beam(Point(0.862 m,-0.562 m,93 m),Point(0 m,-0.562 m,93 m));
Bm121 = Beam(Point(0.862 m,-3 m,93 m),Point(0 m,-3 m,93 m));
Bm122 = Beam(Point(3.3 m,-3 m,93 m),Point(2.681542027 m,-2.316332807 m,93 m));
Bm123 = Beam(Point(3.3 m,-0.562 m,93 m),Point(3.89444303 m,-1.219120153 m,93 m));
//
//
// *************************************************************
// PART 7: Make the Caisson
// *************************************************************
//
// All the connections to main frame is perpendicular from the main frame to the caisson
//
Pipe11.setDefault();
Bm124 = Beam(Point(-9.182m,-2.731m,53m),Point(-4.109m,-2.731m,95m));
Pipe3.setDefault();
Bm125 = Beam(Point(-9.963157895 m,-2.731 m,54 m),Point(-9.074183698 m,-2.731 m,53.89262462 m));
Bm126 = Beam(Point(-7.421052632 m,-2.731 m,75 m),Point(-6.537603098 m,-2.731 m,74.89329192 m));
Bm127 = Beam(Point(-5.242105263 m,-2.731 m,93 m),Point(-4.363391155 m,-2.731 m,92.89386389 m));
Pipe11.setDefault();
Bm128 = Beam(Point(-4.109 m,-2.731 m,95 m),Point(-4.109 m,-2.731 m,97.5 m));
//
//
// *************************************************************
// PART 8: Change the hook-up structure
// *************************************************************
//
//
// Split structure and join the reasonable parts
//
// At elevation 75 split Bm20
Bm20.explode(IndexedNameMask(129));
Validate(Bm129);
Validate(Bm130);
Validate(Bm131);
Validate(Bm132);
Validate(Bm133);
Bm130.joinBeams(Bm131);
Bm130.joinBeams(Bm132);
Rename(Bm130,"Bm20");
Bm129.section = Pipe18;
Bm133.section = Pipe18;
// At elevation 17.785 split Bm57
Bm57.explode(IndexedNameMask(134));
Validate(Bm134);
Validate(Bm135);
Validate(Bm136);
Validate(Bm137);
Bm136.joinBeams(Bm135);
Rename(Bm136,"Bm57");
Bm134.section = Pipe18;
Bm137.section = Pipe18;
//
//
// *************************************************************
// PART 9: Change the leg sections
// *************************************************************
//
// Split structure and join where possible
// Legs between elevation 75m and 93m are segmented members
//
// Split beams first
Bm3.explode(IndexedNameMask(138));
Validate(Bm138);
Validate(Bm139);
Validate(Bm140);
Validate(Bm141);
Validate(Bm142);
Validate(Bm143);
Bm2.explode(IndexedNameMask(144));
Validate(Bm144);
Validate(Bm145);
Validate(Bm146);
Validate(Bm147);
Validate(Bm148);
Validate(Bm149);
Bm1.explode(IndexedNameMask(150));
Validate(Bm150);
Validate(Bm151);
Validate(Bm152);
Validate(Bm153);
Validate(Bm154);
Validate(Bm155);
Validate(Bm156);
Bm4.explode(IndexedNameMask(157));
Validate(Bm157);
Validate(Bm158);
Validate(Bm159);
Validate(Bm160);
Validate(Bm161);
Validate(Bm162);
Validate(Bm163);
//
// Change sections at bottom and top part
//
Bm138.section = Pipe16;
Bm143.section = Pipe16;
Bm144.section = Pipe16;
Bm149.section = Pipe16;
Bm150.section = Pipe16;
Bm156.section = Pipe16;
Bm157.section = Pipe16;
Bm163.section = Pipe16;
//
// Create segmented members for beams between elevation 75m and 93 m
// Use divide at factor 8/18
// Change property for upper half of segmented beam
Bm155.divideSegmentAt(1,0.4444444444);
Bm155.SetSegmentSection(2,Pipe10);
Bm148.divideSegmentAt(1,0.4444444444);
Bm148.SetSegmentSection(2,Pipe10);
Bm142.divideSegmentAt(1,0.4444444444);
Bm142.SetSegmentSection(2,Pipe10);
Bm162.divideSegmentAt(1,0.4444444444);
Bm162.SetSegmentSection(2,Pipe10);
// 
// Join as many of the members on the beams
//
Bm158.joinBeams(Bm159);
Bm158.joinBeams(Bm160);
Bm158.joinBeams(Bm161);
Rename(Bm158,"Bm4");
Bm151.joinBeams(Bm152);
Bm151.joinBeams(Bm153);
Bm151.joinBeams(Bm154);
Rename(Bm151,"Bm1");
Bm145.joinBeams(Bm146);
Bm145.joinBeams(Bm147);
Rename(Bm145,"Bm2");
Bm139.joinBeams(Bm140);
Bm139.joinBeams(Bm141);
Rename(Bm139,"Bm3");
//
//
// *************************************************************
// PART 10: Final adjustments
// *************************************************************
//
// Some small adjustments to ensure that model is in accordance 
// with drawings

// Adjusting sections in elevation 30m
// Split structure and join afterwards
//
Bm88.explode(IndexedNameMask(151));
Validate(Bm151);
Validate(Bm152);
Validate(Bm153);
Validate(Bm154);
Bm87.explode(IndexedNameMask(130));
Validate(Bm130);
Validate(Bm131);
Bm131.section = Pipe8;
Bm154.section = Pipe8;
//
//
//Include one missing beam at elevation 30m along x= 4.52 m
Pipe12.setDefault();
Bm132 = Beam(Point(4.52 m,-4.75 m,30 m),Point(4.52 m,-1.75 m,30 m));
//
// Adding some vertical members between elevations 2.5 and 30 m
//
Pipe3.setDefault();
Bm135 = Beam(Point(0 m,-13.84226013 m,17.82480761 m),Point(2.081 m,-15.69736842 m,2.5 m));
Bm136 = Beam(Point(-14.34710426 m,0.09810574552 m,17.7847909 m),Point(-16.19736842 m,0.25 m,2.5 m));
Bm139 = Beam(Point(0 m,13.84226013 m,17.82480761 m),Point(2.081 m,15.69736842 m,2.5 m));
Bm140 = Beam(Point(14.33546771 m,0 m,17.88091889 m),Point(16.19736842 m,0 m,2.5 m));
//
// Adding the inside triangular at the bottom where top point is x=2.081, y=0.25, z=17.5
Pipe3.setDefault();
Bm141 = Beam(Point(2.081 m,-15.69736842 m,2.5 m),Point(2.081 m,0.25m,17.5m));
Bm145 = Beam(Point(2.081 m,15.69736842 m,2.5 m),Point(2.081 m,0.25 m,17.5 m));
Bm146 = Beam(Point(-16.19736842 m,0.25 m,2.5 m),Point(2.081 m,0.25 m,17.5 m));
Pipe9.setDefault();
Bm147 = Beam(Point(2.081 m,0.25 m,2.5 m),Point(2.081 m,0.25 m,17.5 m));
//
// Removing four beams between elevation 75m and 93m
//
Delete(Bm50);
Delete(Bm52);
Delete(Bm54);
Delete(Bm55);
//
//
// *************************************************************
// PART 11: Make one loadcase
// *************************************************************
//
// Defining the one single loadcase with gravity load
//****************************************************
//
LC_Mass = LoadCase();
LC_Mass.setAcceleration(Vector3d(0 m/s^2,0 m/s^2,-9.80665 m/s^2));
LC_Mass.includeSelfWeight();
//
//
// *************************************************************
// PART 12: Add boundary conditions
// *************************************************************
//
// First set contains supernodes when connecting to a barge
//
//Sp1 = SupportPoint(Point(16.19736842 m,-6.921 m,2.5 m));
//Sp2 = SupportPoint(Point(16.19736842 m,6.921 m,2.5 m));
//Sp3 = SupportPoint(Point(12.86842105 m,-6.921 m,30 m));
//Sp4 = SupportPoint(Point(12.86842105 m,6.921 m,30 m));
//Sp5 = SupportPoint(Point(9.963157895 m,-9.463157895 m,54 m));
//Sp6 = SupportPoint(Point(9.963157895 m,9.463157895 m,54 m));
//Sp7 = SupportPoint(Point(7.421052632 m,-6.921052632 m,75 m));
//Sp8 = SupportPoint(Point(7.421052632 m,6.921052632 m,75 m));
//Sp2.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp5.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp4.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp3.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp6.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp1.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp7.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//Sp8.boundary = BoundaryCondition(Super, Super, Super, Free, Free, Free);
//
// Second set contains fixed at bottom when analysing in Genie with self weight
// (Remember to delete above boundary conditions before using the following ones).
//
Sp1 = SupportPoint(Point(-16.5 m,-16 m,0 m));
Sp2 = SupportPoint(Point(16.5 m,-16 m,0 m));
Sp3 = SupportPoint(Point(16.5 m,16 m,0 m));
Sp4 = SupportPoint(Point(-16.5 m,16 m,0 m));
Sp5 = SupportPoint(Point(0.862 m,-3 m,0 m));
Sp6 = SupportPoint(Point(3.3 m,-3 m,0 m));
Sp7 = SupportPoint(Point(0.862 m,-0.562 m,0 m));
Sp8 = SupportPoint(Point(3.3 m,-0.562 m,0 m));
Sp2.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp5.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp6.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp8.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp7.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp1.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp3.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
Sp4.boundary = BoundaryCondition(Fixed, Fixed, Fixed, Free, Free, Free);
//
//
// *************************************************************
// PART 13: Make named sets
// *************************************************************
//
//
Leg1 = Set();
Leg1.add(Bm150);
Leg1.add(Bm1);
Leg1.add(Bm155);
Leg1.add(Bm156);
//
Leg2 = Set();
Leg2.add(Bm144);
Leg2.add(Bm2);
Leg2.add(Bm148);
Leg2.add(Bm149);
//
Leg3 = Set();
Leg3.add(Bm138);
Leg3.add(Bm3);
Leg3.add(Bm142);
Leg3.add(Bm143);
//
Leg4 = Set();
Leg4.add(Bm157);
Leg4.add(Bm4);
Leg4.add(Bm162);
Leg4.add(Bm163);
//
Legs = Set();
Legs.add(Leg1);
Legs.add(Leg2);
Legs.add(Leg3);
Legs.add(Leg4);
//
Cond_s = Set();
Cond_s.add(Cond2);
Cond_s.add(Cond1);
Cond_s.add(Cond3);
Cond_s.add(Cond4);
//
Elev_2_5 = Set();
Elev_2_5.add(Bm5);
Elev_2_5.add(Bm6);
Elev_2_5.add(Bm8);
Elev_2_5.add(Bm7);
Elev_2_5.add(Bm60);
Elev_2_5.add(Bm65);
Elev_2_5.add(Bm67);
Elev_2_5.add(Bm66);
Elev_2_5.add(Bm68);
Elev_2_5.add(Bm70);
Elev_2_5.add(Bm69);
Elev_2_5.add(Bm71);
Elev_2_5.add(Bm74);
Elev_2_5.add(Bm73);
Elev_2_5.add(Bm72);
Elev_2_5.add(Bm77);
Elev_2_5.add(Bm75);
Elev_2_5.add(Bm76);
Elev_2_5.add(Bm78);
Elev_2_5.add(Bm79);
//
Elev_17 = Set();
Elev_17.add(Bm57);
Elev_17.add(Bm58);
Elev_17.add(Bm59);
Elev_17.add(Bm134);
Elev_17.add(Bm137);
//
Elev_30 = Set();
Elev_30.add(Bm9);
Elev_30.add(Bm12);
Elev_30.add(Bm10);
Elev_30.add(Bm11);
Elev_30.add(Bm61);
Elev_30.add(Bm85);
Elev_30.add(Bm84);
Elev_30.add(Bm132);
Elev_30.add(Bm86);
Elev_30.add(Bm151);
Elev_30.add(Bm89);
Elev_30.add(Bm92);
Elev_30.add(Bm91);
Elev_30.add(Bm90);
Elev_30.add(Bm95);
Elev_30.add(Bm93);
Elev_30.add(Bm94);
Elev_30.add(Bm96);
Elev_30.add(Bm97);
Elev_30.add(Bm130);
Elev_30.add(Bm131);
Elev_30.add(Bm154);
Elev_30.add(Bm153);
Elev_30.add(Bm152);
//
Elev_54 = Set();
Elev_54.add(Bm15);
Elev_54.add(Bm13);
Elev_54.add(Bm14);
Elev_54.add(Bm16);
Elev_54.add(Bm62);
Elev_54.add(Bm98);
Elev_54.add(Bm99);
Elev_54.add(Bm102);
Elev_54.add(Bm101);
Elev_54.add(Bm100);
Elev_54.add(Bm105);
Elev_54.add(Bm103);
Elev_54.add(Bm104);
Elev_54.add(Bm106);
//
Elev_75 = Set();
Elev_75.add(Bm18);
Elev_75.add(Bm17);
Elev_75.add(Bm19);
Elev_75.add(Bm63);
Elev_75.add(Bm108);
Elev_75.add(Bm107);
Elev_75.add(Bm109);
Elev_75.add(Bm112);
Elev_75.add(Bm111);
Elev_75.add(Bm110);
Elev_75.add(Bm115);
Elev_75.add(Bm113);
Elev_75.add(Bm114);
Elev_75.add(Bm129);
Elev_75.add(Bm20);
Elev_75.add(Bm133);
//
Elev_93 = Set();
Elev_93.add(Bm23);
Elev_93.add(Bm21);
Elev_93.add(Bm22);
Elev_93.add(Bm24);
Elev_93.add(Bm64);
Elev_93.add(Bm116);
Elev_93.add(Bm118);
Elev_93.add(Bm117);
Elev_93.add(Bm119);
Elev_93.add(Bm122);
Elev_93.add(Bm121);
Elev_93.add(Bm120);
Elev_93.add(Bm123);
//
Caisson = Set();
Caisson.add(Bm125);
Caisson.add(Bm124);
Caisson.add(Bm126);
Caisson.add(Bm128);
Caisson.add(Bm127);
//
Frames = Set();
Frames.add(Bm26);
Frames.add(Bm25);
Frames.add(Bm29);
Frames.add(Bm27);
Frames.add(Bm28);
Frames.add(Bm30);
Frames.add(Bm33);
Frames.add(Bm32);
Frames.add(Bm31);
Frames.add(Bm36);
Frames.add(Bm35);
Frames.add(Bm34);
Frames.add(Bm43);
Frames.add(Bm37);
Frames.add(Bm38);
Frames.add(Bm40);
Frames.add(Bm39);
Frames.add(Bm42);
Frames.add(Bm41);
Frames.add(Bm46);
Frames.add(Bm44);
Frames.add(Bm45);
Frames.add(Bm49);
Frames.add(Bm47);
Frames.add(Bm48);
Frames.add(Bm53);
Frames.add(Bm51);
Frames.add(Bm56);
Frames.add(Bm139);
Frames.add(Bm135);
Frames.add(Bm136);
Frames.add(Bm145);
Frames.add(Bm140);
Frames.add(Bm141);
Frames.add(Bm146);
Frames.add(Bm147);
//
Fr_XZneg = Set();
Fr_XZneg.add(Bm5);
Fr_XZneg.add(Bm9);
Fr_XZneg.add(Bm13);
Fr_XZneg.add(Bm17);
Fr_XZneg.add(Bm134);
Fr_XZneg.add(Bm21);
Fr_XZneg.add(Bm26);
Fr_XZneg.add(Bm25);
Fr_XZneg.add(Bm33);
Fr_XZneg.add(Bm34);
Fr_XZneg.add(Bm42);
Fr_XZneg.add(Bm41);
Fr_XZneg.add(Bm49);
Fr_XZneg.add(Bm58);
Fr_XZneg.add(Bm121);
Fr_XZneg.add(Bm144);
Fr_XZneg.add(Bm2);
Fr_XZneg.add(Bm148);
Fr_XZneg.add(Bm149);
Fr_XZneg.add(Bm150);
Fr_XZneg.add(Bm1);
Fr_XZneg.add(Bm135);
Fr_XZneg.add(Bm155);
Fr_XZneg.add(Bm156);
Fr_XZneg.add(Sp5);
Fr_XZneg.add(Sp7);
//
Fr_YZpos = Set();
Fr_YZpos.add(Bm6);
Fr_YZpos.add(Bm10);
Fr_YZpos.add(Bm14);
Fr_YZpos.add(Bm18);
Fr_YZpos.add(Bm22);
Fr_YZpos.add(Bm27);
Fr_YZpos.add(Bm28);
Fr_YZpos.add(Bm36);
Fr_YZpos.add(Bm35);
Fr_YZpos.add(Bm43);
Fr_YZpos.add(Bm44);
Fr_YZpos.add(Bm51);
Fr_YZpos.add(Sp1);
Fr_YZpos.add(Sp4);
Fr_YZpos.add(Sp3);
Fr_YZpos.add(Bm138);
Fr_YZpos.add(Bm3);
Fr_YZpos.add(Bm142);
Fr_YZpos.add(Bm143);
Fr_YZpos.add(Bm144);
Fr_YZpos.add(Bm2);
Fr_YZpos.add(Bm148);
Fr_YZpos.add(Bm149);
Fr_YZpos.add(Bm140);
Fr_YZpos.add(Sp2);
Fr_YZpos.add(Sp5);
Fr_YZpos.add(Sp6);
Fr_YZpos.add(Sp7);
Fr_YZpos.add(Sp8);
//
Fr_XZpos = Set();
Fr_XZpos.add(Bm7);
Fr_XZpos.add(Bm11);
Fr_XZpos.add(Bm15);
Fr_XZpos.add(Bm19);
Fr_XZpos.add(Bm23);
Fr_XZpos.add(Bm30);
Fr_XZpos.add(Bm29);
Fr_XZpos.add(Bm38);
Fr_XZpos.add(Bm39);
Fr_XZpos.add(Bm46);
Fr_XZpos.add(Bm47);
Fr_XZpos.add(Bm53);
Fr_XZpos.add(Bm59);
Fr_XZpos.add(Bm138);
Fr_XZpos.add(Bm3);
Fr_XZpos.add(Bm142);
Fr_XZpos.add(Bm143);
Fr_XZpos.add(Bm157);
Fr_XZpos.add(Bm4);
Fr_XZpos.add(Bm162);
Fr_XZpos.add(Bm163);
Fr_XZpos.add(Bm139);
Fr_XZpos.add(Sp6);
Fr_XZpos.add(Sp8);
//
Fr_YZneg = Set();
Fr_YZneg.add(Bm8);
Fr_YZneg.add(Bm12);
Fr_YZneg.add(Bm16);
Fr_YZneg.add(Bm134);
Fr_YZneg.add(Bm57);
Fr_YZneg.add(Bm24);
Fr_YZneg.add(Bm31);
Fr_YZneg.add(Bm32);
Fr_YZneg.add(Bm37);
Fr_YZneg.add(Bm40);
Fr_YZneg.add(Bm45);
Fr_YZneg.add(Bm48);
Fr_YZneg.add(Bm56);
Fr_YZneg.add(Bm129);
Fr_YZneg.add(Bm20);
Fr_YZneg.add(Bm133);
Fr_YZneg.add(Bm137);
Fr_YZneg.add(Bm150);
Fr_YZneg.add(Bm1);
Fr_YZneg.add(Bm155);
Fr_YZneg.add(Bm156);
Fr_YZneg.add(Bm157);
Fr_YZneg.add(Bm4);
Fr_YZneg.add(Bm162);
Fr_YZneg.add(Bm163);
Fr_YZneg.add(Bm136);
//
Complete = Set();
Complete.add(Legs);
Complete.add(Cond_s);
Complete.add(Elev_2_5);
Complete.add(Elev_17);
Complete.add(Elev_30);
Complete.add(Elev_54);
Complete.add(Elev_75);
Complete.add(Elev_93);
Complete.add(Caisson);
Complete.add(Fr_XZneg);
Complete.add(Fr_XZpos);
Complete.add(Fr_YZneg);
Complete.add(Fr_YZpos);
Complete.add(Frames);
//
//
// *************************************************************
// PART 13: Create FEM and export 
// *************************************************************
//
// Create mesh and export the T1.FEM file
// ***************************************
//
// NOTE: IT IS IMPORTANT TO WRITE DOWN THE 3 FOLLOWING COMMANDS TO CREATE THE SAME
// FEM MODEL OVER AND OVER AGAIN AND TO EXPORT IT
// ALSO, YOU SHOULD USE A PATH WHEN TYPING IN THE FEM FILE NAME - AS IT IS NOW, THE FEM
// FILE WILL BE WRITTEN TO THE DIRECTORY FROM WHERE THIS INPUT FILE WAS ACCESSED.
//
SimplifyTopology();
CreateMesh();
ExportMeshFem().DoExport("T1.FEM");
//
//
// The End