![]() |
![]() |
![]() |
This code solves three-dimensional linearized elastostatics problems. Its main structure is exactly the same as the 2-D code.
IPF data("lelas3d - 1.2",argv[1]);
int verbose = data.getVerbose(), output_flag = data.getOutput(), save_flag = data.getSave();
Mesh ms(data.getMeshFile(),true);
int nb_dof = ms.getDim();
Prescription p(ms,data.getDataFile());
|
SpMatrix<double> A(ms); Vect<double> b(ms.getNbEq()), u(ms.getNbEq()); |
NodeVect<double> bc(ms,nb_dof,"bc"); NodeVect<double> body_f(ms,nb_dof,"body_f"); p.get(BOUNDARY_CONDITION,bc,0); p.get(BODY_FORCE,body_f,0); |
MeshElements(ms) {
Elas3DT4 eq(theElement);
eq.Deviator();
eq.Dilatation();
eq.BodyRHS(body_f);
eq.updateBC(BCVect<double>(bc));
eq.ElementAssembly(A);
eq.ElementAssembly(b);
}
|
CG(A,Prec<double>(A,DIAG_PREC),b,u,1000,toler,1); |
NodeVect<double> uf(ms,u,BCVect<double>(bc),"Displacement");
if (save_flag) {
IOField pf(data.getPlotFile(),OUT);
pf.put(uf);
DeformMesh(ms,uf,1);
ms.put(data.getProject()+"-1.m");
}
|
<?xml version="1.0" encoding="ISO-8859-1" ?> <OFELI_File> <info> <title></title> <date></date> <author></author> </info> <Project name="beam"> <verbose>1</verbose> <output>0</output> <save>1</save> <plot>1</plot> <init>1</init> <mesh_file>beam.m</mesh_file> <plot_file>beam.d</plot_file> </Project> <Prescription> <BodyForce dof="3">-1.0</BodyForce> </Prescription> </OFELI_File> |
We note here that the file gives project parameters and prescriptions as well. Indeed, we have prescribed a vertical body force equal to -1 to the beam.
![]() |
![]() |
![]() |