Getting Started
15 minutes basic
Lesson Objectives
Run a simple MFEM code to test the environment.
Note
https://SESSION.mfem.hpcic.training?folder=/home/euler/mfem and
https://SESSION.mfem.hpcic.training/glvis/live/?socket=/glvis-ws.
If you are running a Docker container locally, follow the local URLs in the Local Docker Container page.
Set up VS Code
-
Open the VS Code URL in a new browser window.
-
You should see the Visual Studio Code (VS Code) interface.
-
Click on
Mark Doneto continue. -
If the VS Code URL includes
?folder=/home/euler/mfem, the MFEM directory opens automatically and you can skip the next step.

-
(If needed) Click on
open a folder(underRecent), then selectmfem, then clickOK. -
In the left pane, open
examplesand selectex1.cpp. -
Open a new terminal by clicking on in the upper left corner, then
Terminal, and thenNew Terminal. -
Alternatively you can open a new terminal by pressing Ctrl + Shift + `.
-
You should now see the MFEM source tree and a terminal in the
~/mfemdirectory.

Note
Set up GLVis
In this tutorial we use GLVis for finite element visualization based on MFEM.
-
Open the GLVis URL in a new browser window.
-
When you move the mouse to the top of the window you should see the GLVis interface:

-
If the GLVis URL includes
?socket=/glvis-ws, it is already connected and you can skip the next step. -
(If needed) Click the Connect to socket icon in the upper left corner, then enter the current host name followed by
/glvis-wsin the Host field, for exampleSESSION.mfem.hpcic.training/glvis-wsorlocalhost:3000/glvis-ws, and clickCONNECT. When the button switches toDISCONNECT, click outside of the Connect to socket dialog to close it. -
Your environment should now look like:

Simple test
-
To test your environment, run
ex1, which together with the MFEM library itself, comes pre-build in the AWS image. -
In the VS Code terminal, type
cd examples ./ex1 -
You should see
111iterations printed in the terminal and the image in the GLVis window should change:

- To test the visualization, click in the GLVis window, and make sure you can rotate the plot with the Left mouse button and zoom in/out with the Right mouse button.
Questions?
Next Steps
Back to the MFEM tutorial page