-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain_steadyStateGeometricallyLinearPlateInMembraneAction.m
More file actions
149 lines (121 loc) · 5.03 KB
/
Copy pathmain_steadyStateGeometricallyLinearPlateInMembraneAction.m
File metadata and controls
149 lines (121 loc) · 5.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
%% Licensing
%
% License: BSD License
% cane Multiphysics default license: cane/license.txt
%
% Main authors: Andreas Apostolatos
%
%% Script documentation
%
% Task : Plane stress analysis for a rectangular plate subject to uniform
% pressure on its top edge
%
% Date : 19.02.2014
%
%% Preamble
clear;
clc;
close all;
%% Includes
% Add general math functions
addpath('../../generalMath/');
% Add all functions related to parsing
addpath('../../parsers/');
% Add all functions related to the low order basis functions
addpath('../../basisFunctions/');
% Add all equation system solvers
addpath('../../equationSystemSolvers/');
% Add all the efficient computation functions
addpath('../../efficientComputation/');
% Add all functions related to plate in membrane action analysis
addpath('../../FEMPlateInMembraneActionAnalysis/solvers/',...
'../../FEMPlateInMembraneActionAnalysis/solutionMatricesAndVectors/',...
'../../FEMPlateInMembraneActionAnalysis/loads/',...
'../../FEMPlateInMembraneActionAnalysis/graphics/',...
'../../FEMPlateInMembraneActionAnalysis/output/',...
'../../FEMPlateInMembraneActionAnalysis/postprocessing/',...
'../../FEMPlateInMembraneActionAnalysis/errorComputation/');
% Include performance optimzed functions
addpath('../../efficientComputation/');
%% Parse data from GiD input file
% Define the path to the case
pathToCase = '../../inputGiD/FEMPlateInMembraneActionAnalysis/';
% caseName = 'infinitePlateWithHoleQuadrilaterals';
caseName = 'cantileverBeamPlaneStress';
% caseName = 'PlateWithAHolePlaneStress';
% caseName = 'PlateWithMultipleHolesPlaneStress';
% caseName = 'InfinitePlateWithAHolePlaneStress';
% caseName = 'unitTest_curvedPlateTipShearPlaneStress';
% caseName = 'gammaStructureMixedElementsPlaneStress';
% caseName = 'NACA2412_AoA5_CSD';
% Parse the data from the GiD input file
[strMsh, homDOFs, inhomDOFs, valuesInhomDOFs, propNBC, propAnalysis, ...
parameters, propNLinearAnalysis, ~, propGaussInt] = ...
parse_StructuralModelFromGid(pathToCase, caseName, 'outputEnabled');
%% GUI
% On the body forces
computeBodyForces = @computeConstantVerticalStructureBodyForceVct;
% Choose equation system solver
solve_LinearSystem = @solve_LinearSystemMatlabBackslashSolver;
% solve_LinearSystem = solve_LinearSystemGMResWithIncompleteLUPreconditioning;
% Output properties
propOutput.isOutput = true;
propOutput.writeOutputToFile = @writeOutputFEMPlateInMembraneActionToVTK;
propOutput.VTKResultFile = 'undefined';
% Choose computation of the stiffness matrix
computeStiffMtxLoadVct = @computeStiffMtxAndLoadVctFEMPlateInMembraneActionCST;
% computeStiffMtxLoadVct = @computeStiffMtxAndLoadVctFEMPlateInMembraneActionMixed;
% Quadrature for the stiffness matrix and the load vector of the problem
% 'default', 'user'
propIntDomain.type = 'default';
propIntDomain.noGP = 1;
% Quadrature for the L2-norm of the error
intError.type = 'user';
intError.noGP = 4;
% Linear analysis
propStrDynamics = 'undefined';
% Initialize graphics index
graph.index = 1;
%% Output data to a VTK format
pathToOutput = '../../outputVTK/FEMPlateInMembraneActionAnalysis/';
%% Compute the load vector
t = 0;
F = computeLoadVctFEMPlateInMembraneAction ...
(strMsh, propAnalysis, propNBC, t, propGaussInt, 'outputEnabled');
%% Visualization of the configuration
graph.index = plot_referenceConfigurationFEMPlateInMembraneAction ...
(strMsh, propAnalysis, F, homDOFs, [], graph, 'outputEnabled');
%% Initialize solution
numNodes = length(strMsh.nodes(:,1));
numDOFs = 2*numNodes;
dHat = zeros(numDOFs,1);
%% Solve the plate in membrane action problem
[dHat, FComplete, minElSize] = solve_FEMPlateInMembraneAction ...
(propAnalysis, strMsh, dHat, homDOFs, inhomDOFs, valuesInhomDOFs, ...
propNBC, computeBodyForces, parameters, computeStiffMtxLoadVct, ...
solve_LinearSystem, propNLinearAnalysis, propIntDomain, propOutput, ...
caseName, pathToOutput, 'outputEnabled');
%% Postprocessing
graph.visualization.geometry = 'reference_and_current';
resultant = 'stress';
component = 'xy';
nodeIDs_active = 'undefined';
contactSegments = 'undefined';
graph.index = plot_currentConfigurationAndResultants ...
(propAnalysis, strMsh, homDOFs, dHat, nodeIDs_active, contactSegments, ...
parameters, resultant, component, graph);
% Compute the error in the L2-norm for the case of the plane stress
% analysis over a quarter annulus plate subject to tip shear force
if strcmp(caseName,'unitTest_curvedPlateTipShearPlaneStress')
nodeNeumann = strMsh.nodes(propNBC.nodes(1, 1), 2:end);
funHandle = str2func(propNBC.fctHandle(1, :));
forceAmplitude = norm(funHandle(nodeNeumann(1, 1),nodeNeumann(1, 2),nodeNeumann(1, 3), 0));
internalRadius = 4;
externalRadius = 5;
propError.resultant = 'stress';
propError.component = 'tensor';
errorL2 = computeRelErrorL2CurvedBeamTipShearFEMPlateInMembraneAction ...
(strMsh, dHat, parameters, internalRadius, externalRadius, ...
forceAmplitude, propError, intError, 'outputEnabled');
end
%% END OF THE SCRIPT