This repository contains the code, LaTeX files, and other resources for the C++ Finite Element Method (FEM) project. The project involves solving a Poisson-type partial differential equation (PDE) in a 2D domain using FEM and includes documentation and source code to guide students through the implementation, testing, and reporting process.
|
Important
|
Update this file by the end of the project to describe your repository structure and the exact commands needed to build, test, and run your code. |
This is an individual project: each student maintains their own repository, report, and AI usage journal.
This repository provides the scientific project brief, meshes, two C++ examples, and a report template. Students must implement the CMake build, tests, CI, and Docker setup; these are not preconfigured. Creating a repository from this template does not automatically configure branch protection, permissions, or GitHub Classroom.
-
Proposed Project Course Rubric and Required Deliverables — subject to instructor approval before distribution.
-
AI Usage and Full Disclosure, based on the referenced CSMI AI policy.
-
AI Disclosure Statement and Journal to Be Completed by Students.
The dates and grading weights in project.tex are historical. Instructors will confirm the requirements for the new cohort.
-
project.tex: The main LaTeX file for the project, describing the objectives, methods, and overall instructions for solving the FEM problem. -
report.tex: A template for the students to use when writing their project report. -
meshes/: Contains various mesh files (.msh) that students will use for their FEM simulations. -
src/: Contains sample C++ code to help students get started with FEM implementation. -
tex/: Includes LaTeX macros used byproject.texandreport.tex. -
.vscode/: VSCode configuration for LaTeX settings, ensuring consistent formatting and build processes for LaTeX documents.
To work on this project, you’ll need the following tools installed:
- C++ Compiler
-
Ensure you have a C++ compiler like
g` or `clang. - Eigen Library
-
Eigen is used for linear algebra in this project.
- Gmsh
-
Gmsh is used for generating mesh files.
- LaTeX
-
For generating project reports and reading project documentation.
- Git
-
Version control for tracking your progress and submitting your project.
- VSCode with LaTeX Workshop
-
Recommended editor for LaTeX. The
.vscode/directory contains settings for this.
The project brief and report share the tex/csmi.sty style (cover page, typography, colors, and callout boxes). See the style documentation for customization instructions.
The .latexmkrc configuration places generated PDFs in output/pdf/. Students must configure their CI to retain these PDFs as artifacts.
- project.tex
-
This file contains detailed project instructions. Compile it with:
latexmk -pdf -interaction=nonstopmode -halt-on-error project.tex- report.tex
-
Use this template to create your project report. Customize it with your own content, results, and analysis. Compile it similarly:
latexmk -pdf -interaction=nonstopmode -halt-on-error report.tex|
Note
|
The VSCode settings provide LaTeX Workshop recipes that use latexmk to compile documents from the editor.
|
- Repository Setup
-
Clone this repository to your local machine:
git clone <YOUR_INDIVIDUAL_REPOSITORY_URL>
cd <REPOSITORY_NAME>- Branching
-
Create a separate branch for each issue, feature, or bug fix:
git checkout -b <BRANCH_NAME>- Commits
-
Make commits regularly with meaningful messages:
git commit -m "Implemented FEM solver"- Pull Requests
-
When ready, push your branch and open a pull request (PR) to merge changes into the
mainbranch. Configure your CI to check that the code builds, runs, and passes its tests on each PR. Use PRs to record self-review and instructor feedback.
|
Note
|
GitHub Classroom can create a feedback PR if instructors enable that feature. Creating a repository from this template alone does not create this PR.
|
Students must set up GitHub Actions to compile and test the code on pushes and pull requests. Create the configuration in .github/workflows/; no workflow is supplied in this starter. To set up CI:
-
Write unit tests for your FEM code.
-
Ensure tests are automatically run with each PR by configuring GitHub Actions.
To make your project easily reproducible, you have to containerize it using Docker. The repository can include a Dockerfile that compiles and runs the C++ code inside a Docker container:
docker build -t fem_project .
docker run fem_project|
Note
|
The Docker image must be built by your GitHub Actions workflow. |
The project covers the following key topics:
- Solving Poisson-type PDEs using FEM.
- Meshing using Gmsh and processing meshes in C++.
- Post-processing of results using ParaView.
This project is licensed under the MIT License.