Download and run “FEAtext.cpp” and “FEApixel.cpp”. Make some kind of changes to
ID: 3831587 • Letter: D
Question
Download and run “FEAtext.cpp” and “FEApixel.cpp”. Make some kind of changes to one or both of them and turn in the modified code and output.
1) Change the transfer function by using some other rules of physics like Bernoulli’s Principle or the Gas Laws. Or, just some unique rules you make up yourself.
2) Add some more blockages, or a more complex “maze” or “venturi” to simulate fluid flow in a more interesting way.
3) Extend the program to read in data from a large file, perhaps read a prepared bitmap.bmp file and use that to initialize a large map with blockages and initial Q sources. (Red could be blocked, Black could be Q). You could also use grayscale values to represent height, and use that to modify flow rates.
a. Write the intermediate and/or results back to a bitmap file! That would be way cool!
b. If you have an animated gif editor and know how to do that, compile a series of bmp’s into an animated gif.
4) Extend the program into a 3-Dimensional rectangular array.
5) Extend the program to use tetrahedral polygons (aka mesh, stl format, etc) instead of cubes. This may require a graph representation. Good luck with that!
6) Some other change(s), be creative!
“FEAtext.cpp” is below
“FEApixel.cpp” is below: