FINITE ELEMENTS
SYMBOLIC PROGRAMMING IN MAPLE
by Artur Portela
Elastics Example 1:
Traction of a Square Plate
> restart;
> interface(verboseproc=3):printlevel:=3:
> libname := "C:/mylib/fem", libname;
> with(Plotter):
> with(Cst_fem): with(G_cst_fem):
Data Preparation
The best way to input data for Cst_fem is to use the procedure read_save_data , which reads a file with the following structure:
*elements*
[element, node1, node2, node3, material]
1 1 2 4 1
2 4 3 1 1
*nodes*
[node, x, y]
1 1 1
2 0 1
3 1 0
4 0 0
*materials*
[material, Young modulus, Poisson coef, specific weight, thickness]
1 210000000000. .28 -77000. 0.01
*forces*
[node, fx, fy]
1 0 10
2 0 10
*constraints*
[node, direction(x, y or angle measured from x), displacement]
4 x 0
4 y 0
3 90 0
2 0 0
*control*
[title, plane stress/strain, point forces, self weight]
title Plate Under Uniaxial Traction
plane stress
point forces
*end*
The data blocks, with the respective keyword on the top, can be given in any order.
Alternatively, data can be given manually through the definition of the variables: title , plane_case , control , nods , mat_props , elems , forces and bdr_conds . See bellow the structure of these variables.
>
Traction of a Square Plate
As the first problem, consider the case of a square plate, with 2
m
of length and 0.01
m
thick, under the action of a load of 20
kN/
, uniformly distributed on the sides perpendicular to the
y
direction. Since the problem is symmetric, a quarter of the plate, the first quadrant, will be analysed, with the symmetry boundary conditions. The material properties are
E=
210*
kN/
and
.
Since the state of stress of the plate is constant, as is the stress field of the triangular finite element, the finite element analysis will lead to the exact solution. Hence, the discretization of the plate needs to consider only 2 finite elements, which correctly describe the plate geometry. Note that, in the finite element mesh, the distributed load is replaced by the equivalent nodal loads.
> read_save_data();
read data from a file (y/n) ? y;
file name: "dat_test4.txt";
save data into a file (y/n) ? y;
file name: "check.txt";
This is the finite element data just red :
> tcase;plane_case;control;nods;mat_props;elems;forces;bdr_conds;
The first thing to do is to check data
> plot_problem_data();
> plot_mesh();
After checking data, run the finite element procedure
> cst_fem("anything here will print intermediate results");
The results obtained are in the following variables, which have the structure:
> #disp;e_sigma;n_sigma;
> plot_displacements();
It is simple to zoom in any window: ([lower left corner coordinates of the window],[upper right corner coordinates of the window])
> plot_displacements([0.8,-0.1],[1.1,0.1]);
> animate_displacements();
Plot element principal stresses
> [seq(e_sigma[i][2],i=1..nops(e_sigma))];
> plot_stresses(%);
plot title: "Element Principal Stresses";
Plot nodal principal stresses
> [seq(n_sigma[i][1..3],i=1..nops(n_sigma))];
> plot_stresses(%);
plot title: "Nodal Principal Stresses";
Zoom in
> plot_stresses([seq(n_sigma[i][1..3],i=1..nops(n_sigma))],[0.9,0.8],[1.1,1.15]);
plot title: "Nodal Principal Stresses";
>