|
| 1 | +%md# Rectangular Plate test |
| 2 | +%md |
| 3 | +close all, clear all |
| 4 | +addpath( genpath( getenv('ONSAS_PATH') ) ); |
| 5 | +%md Scalar parameters |
| 6 | +E = 1e3 ; |
| 7 | +nu = 0.0 ; |
| 8 | +tz = .1 ; |
| 9 | +q = 1 ; |
| 10 | + |
| 11 | +materials = struct() ; |
| 12 | +materials.modelName = 'elastic-linear' ; |
| 13 | +materials.modelParams = [ E nu ] ; |
| 14 | + |
| 15 | +elements = struct() ; |
| 16 | +elements(1).elemType = 'edge' ; |
| 17 | +elements(1).elemCrossSecParams = tz ; |
| 18 | +elements(2).elemType = 'triangle-plate'; |
| 19 | +elements(2).elemCrossSecParams = {'thickness', tz } ; |
| 20 | + |
| 21 | +% ----------------------------------------------------- |
| 22 | +boundaryConds = struct() ; |
| 23 | + |
| 24 | +boundaryConds(1).imposDispDofs = [ 1 3 5 ] ; % fixed nodes: 1 2 4 |
| 25 | +boundaryConds(1).imposDispVals = [ 0 0 0 ] ; |
| 26 | + |
| 27 | +boundaryConds(2).loadsCoordSys = 'global' ; |
| 28 | +boundaryConds(2).loadsTimeFact = @(t) t ; |
| 29 | +boundaryConds(2).loadsBaseVals = [ 0 0 0 0 -q 0 ] ; % forces in node 1 |
| 30 | + |
| 31 | +% ----------------------------------------------------- |
| 32 | +base_msh=''; |
| 33 | +if strcmp( getenv('TESTS_RUN'),'yes') && isfolder('examples'), |
| 34 | + base_msh=['.' filesep 'examples' filesep 'rectangularPlate' filesep]; |
| 35 | +end |
| 36 | +mesh = struct(); |
| 37 | +[ mesh.nodesCoords, mesh.conecCell ] = meshFileReader( [ base_msh 'rectangularPlate.msh'] ) ; |
| 38 | + |
| 39 | +% ----------------------------------------------------- |
| 40 | +initialConds = struct(); |
| 41 | +%md |
| 42 | +% ----------------------------------------------------- |
| 43 | +%md#### Analysis parameters |
| 44 | +%md |
| 45 | +%md The Newton-Raphson method is employed to solve 2 load steps. The ratio between `finalTime` and `deltaT` sets the number of load steps used to evaluate `boundaryConds(3).loadsTimeFact` function: |
| 46 | +analysisSettings = struct() ; |
| 47 | +analysisSettings.methodName = 'newtonRaphson' ; |
| 48 | +analysisSettings.stopTolIts = 30 ; |
| 49 | +analysisSettings.stopTolDeltau = 1.0e-12 ; |
| 50 | +analysisSettings.stopTolForces = 1.0e-12 ; |
| 51 | +analysisSettings.finalTime = 1 ; |
| 52 | +analysisSettings.deltaT = 1 ; |
| 53 | +%md |
| 54 | +%md#### Output parameters |
| 55 | +%md |
| 56 | +otherParams = struct() ; |
| 57 | +otherParams.problemName = 'rectangularPlate' ; |
| 58 | +otherParams.plots_format = 'vtk' ; |
| 59 | +%md The ONSAS software is executed for the parameters defined above and the displacement solution of each load(time) step is saved in `matUs`matrix: |
| 60 | +%md |
| 61 | +[ modelCurrSol, modelProperties, BCsData ] = ONSAS_init( materials, elements, boundaryConds, initialConds, mesh, analysisSettings, otherParams ) ; |
| 62 | +% |
| 63 | +%mdAfter that the structs are used to perform the numerical time analysis |
| 64 | +[matUs, loadFactorsMat, modelSolutions ] = ONSAS_solve( modelCurrSol, modelProperties, BCsData ) ; |
| 65 | + |
| 66 | +Lx = max( mesh.nodesCoords(:,1) ) ; |
| 67 | +Ly = max( mesh.nodesCoords(:,2) ) ; |
| 68 | +I = Lx*tz^3/12 ; |
| 69 | + |
| 70 | +q1D = q * Lx ; |
| 71 | + |
| 72 | +theta_max_analy = q1D*Ly^3/(24*E*I ) ; |
| 73 | +delta_max_analy = 5*q1D*Ly^4/(384*E*I) ; |
| 74 | + |
| 75 | +theta_max_numer = abs( max(matUs(2:6:end,2)) ) ; |
| 76 | +delta_max_numer = abs( min(matUs(5:6:end,2)) ) ; |
| 77 | + |
| 78 | +verifBoolean = ( ( theta_max_analy - theta_max_numer ) < 1e-2*theta_max_analy ) && ... |
| 79 | + ( ( delta_max_analy - delta_max_numer ) < 1e-2*delta_max_analy ) ; |
| 80 | + |
0 commit comments