dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #00024
Elasticity Stationary Module
Hi,
I have a couple of questions on elasticity stationary module.
First of all, what's elasticity stationary equation? I googled
"Elasticity Stationary Equation" but did not find a clear answer.
From jj's reply to my previous questions, it seems to me that
elasticity-stationary is also a system of PDEs. However, according
to the code in src/demo/solvers/elasticity-stationary/main.cpp,
int main(int argc, char **argv)
{
Mesh mesh("tetmesh-4.xml.gz");
Problem elasticitystationary("elasticity-stationary", mesh);
elasticitystationary.set("source", f);
elasticitystationary.set("diffusivity", a);
elasticitystationary.set("convection", b);
elasticitystationary.set("boundary condition", mybc);
elasticitystationary.set("final time", 2.0);
elasticitystationary.set("time step", 0.1);
elasticitystationary.solve();
return 0;
}
It looks like this equation depends on the parameters f(),a(),b(),
right? What's the exact formula of it in forms of something like
-div(c*grad(u))+a*u=f
By reading the source files, I assume the statement
elasticitystationary.solve();
will call the function void ElasticityStationarySolver::solve()
defined in
modules/elasticity-stationary/ElasticityStationarySolver.cpp
void ElasticityStationarySolver::solve()
{
Matrix A;
Vector x10, x11, x20, x21, b, xcomp;
Function::Vector u0(mesh, x10, 3);
Function::Vector u1(mesh, x11, 3);
Function::Vector w0(mesh, x20, 3);
Function::Vector w1(mesh, x21, 3);
Function::Vector f("source", 3);
ElasticityStationary elasticity(f, u0, w0);
KrylovSolver solver;
File file("elasticitystationary.m");
// Time independent
// Assemble matrix and vector
FEM::assemble(elasticity, mesh, A, b);
// Solve the linear system
//solver.setMethod(KrylovSolver::CG);
//solver.setPreconditioner(KrylovSolver::ILU0);
solver.solve(A, x11, b);
//x1.show();
//A.show();
//b.show();
//cout << "dot(b, b): " << (b * b) << endl;
//cout << "dot(x, x): " << (x11 * x11) << endl;
//printf("dot(b, b): %30.30lf\n", (b * b));
//printf("dot(x, x): %30.30lf\n", (x11 * x11));
file << u1;
}
But I am really confused by above code. I can not see
(1) how the parameters f,a,b set in main.cpp are used here,
seems the only thing passed in is the mesh.
(2) what are the meanings of those local variables A,u0,u1,w0,w1,
x10,x11,x20,x21,f,b? seems they are initialized by mesh only
(3) how the execution of solver.solve(A,x11,b) changes the
value of u1? looks like the result is stored in the u1.
I would be rather thankful if anybody can clarify my above
questions.
--
Best wishes,
Bing Jian
bjian@xxxxxxxxxxxx
Follow ups