![]() |
![]() |
![]() |
We present a program to solve the time dependent linear elasticity equations (i.e. Elastodynamics) using the P1 finite element method for space discretization and the Newmark scheme for time discretization.
#include "OFELI.h"
#include "Solid.h"
using namespace OFELI;
int main(int argc, char *argv[])
{
theFinalTime = 1.;
Mesh ms(argv[1],true);
theTimeStep = atof(argv[2]);
Vect<double> u(ms), v(ms), bc(ms);
u.set("-0.1",2);
|
Elas2DT3 eq(ms); eq.setTerms(LUMPED_MASS|DEVIATORIC|DILATATION); TimeStepping ts(NEWMARK,theTimeStep,theFinalTime); ts.setPDE(eq); ts.setInitial(u,v); ts.setLinearSolver(CG_SOLVER,DILU_PREC); saveField(u,ms,"u-0.vtk",VTK); |
TimeLoop {
bc.setTime(theTime);
ts.setBC(bc);
ts.runOneTimeStep();
saveField(u,ms,"u-"+itos(theStep)+".vtk",VTK);
Mesh dm(ms);
DeformMesh(dm,u,1.);
dm.save("mm-"+itos(theStep)+".m");
}
return 0;
}
|
![]() |
![]() |
![]() |