By Mark S. Gockenbach (siam, 2010)



Download 2.45 Mb.
Page25/25
Date09.06.2018
Size2.45 Mb.
#53772
1   ...   17   18   19   20   21   22   23   24   25

T=RectangleMeshD1(8);

K=Stiffness1(T,a);

F=Load1(T,f);

U=K\F;

V=NodalValues1(T,u);

ShowPWLinFcn1(T,V-U)




T=RectangleMeshD1(16);

K=Stiffness1(T,a);

F=Load1(T,f);

U=K\F;

V=NodalValues1(T,u);

ShowPWLinFcn1(T,V-U)




Using the code



My purpose for providing this code is so that you can see how finite element methods can be implemented in practice. To really benefit from the code, you should extend its capabilities. By writing some code yourself, you will learn how such programs are written. Here are some projects you might undertake, more or less in order of difficulty:


  1. Write a command called Mass1 that computes the mass matrix. The calling sequence should be simply M=Mass1(T), where T is the triangulation.

  2. Choose some other geometric shapes and/or combinations of boundary conditions, and write some mesh generation routines analogous to RectangleMeshD1.

  3. Extend the code to handle inhomogeneous Dirichlet conditions. Recall that such boundary conditions change the load vector, so the routine Load1 must be modified.

  4. Extend the code to handle inhomogeneous Neumann conditions. Like inhomogeneous Dirichlet conditions, the load vector is affected

  5. (Hard) Write a routine to refine a given mesh, according to the standard method suggested in Exercise 10.1.4 of the text.

As I mentioned above, the mesh data structure described in Mesh1.m includes the information needed to solve exercises 3, 4, and 5.








Download 2.45 Mb.

Share with your friends:
1   ...   17   18   19   20   21   22   23   24   25




The database is protected by copyright ©ininet.org 2024
send message

    Main page