-
Check out the problem repository
git clone https://github.com/solidsgroup/EM525-PS07.git -
Change into the problem directory
cd EM525-PS07 -
Use this command to install eigen (optional: you can skip this if you have eigen installed)
make eigen -
Now, compile the code
makeThe code will not compile because there are missing files. These files must be copied as specified below before you can compile.
Copy the following files directly from PS05.
src/Element/Element.Hsrc/Element/LST.Hsrc/Element/CST.Hsrc/Element/Q4.Hsrc/Element/Q9.Hsrc/Model/Isotropic.H
If you do this correctly the code will compile. However, it will not pass the tests.
Edi the following file
src/Element/Element.H
In your implementation of the Jacobian function, change the node access from
(*X0)[n]
to
(*X0)[id[n]]
The id array is a list of nodal indexes that each element has.
For instance, a Q4 element might have
id = {0, 3, 29, 1}
That is, it is a Q4 element between the nodes indexed by 0, 3, 29, and 1.
Edit the following file
src/Mesh/Unstructured.H
Update the W, DW, and DDW for Q4, LST, and Q9 elements, following the existing
implementation for CST elements.
If you have implemented the above correctly, you can run the tests by
./bin/test
Make sure the tests pass before proceeding to the next part.
In this part we will run an actual FEM simulation.
Edit the following file
src/Mesh/Unstructured.H
Update the Print function by copying in your previous implementation, and also adding the capability to output nodal displacements.
Read through the code in the following file
src/main.cpp
Run the finite element program by compiling and running
./bin/main
This will generate an output mesh called outputfile.vtk which you can view using Paraview or VisIt.
You should be able to visualize the displacement field to inspect the result.
If you cannot, you may need to update the Print function.
Run for all four mesh files, then report and contrast the results.
Modify the boundary conditions in the main.cpp program to cantilever loading.
See the instructions at the bottom of main.cpp.
Re-run with the four meshes and report/contrast the results.