- Below, the directory
.refers to the top level directory of the repository. - Developers only work in
./developers/<ProblemName>/. From this, a corresponding directory./homeworks/<ProblemName>/for the students can be created automatically using./scripts/deploy_npde.py. - Not only the solutions, but also the corresponding templates need to compile and run without crash. So be careful when setting the solution/template tags in
developers/mastersolution/. - The bullets below are only a selection. If you spot additional issues, e.g. ugly or too complicated code, fix it.
- Names of .cc and .h files: For example the files in the folder
./developers/MyHomeworkProblem/mastersolution/should be calledmyhomeworkproblem_main.cc,myhomeworkproblem_foo.cc,myhomeworkproblem_foo.h, where foo is a placeholder for any name (summarized: lowercase, split words by _). - Only in Lehrfem exercises: Use
nostd::span(C++20) instead ofForwardIteratersfor iterating over objects contiguous in memory (used e.g. inMesh::Entities(),SubEntities(),DofHandler).
- Add comments if necessary.
- Use
#include <cmath>instead of#include <math.h>. - Only use the
#includes "..."you need, e.g. forEigen::MatrixXd,#include <Eigen/Core>is sufficient (no#include <Eigen/Dense>needed). Likewise for thedependencies.cmake. However, every file (.hand.cc) should contain all the#includesit needs, not relying on other headers to provide them silently. - Use forward declarations to avoid
#includeswhenever possible. - Make the code follow the Google style (see https://google.github.io/styleguide/cppguide.html). In particular, respect the include order (https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes).
- Never store data in the remote repository that is generated by the code anyway (e.g. figures). The repo should only contain source files (and maybe some mesh files).
- Provide unit tests for all functions that the students have to change.
- Plotting is done as follows: The C++ code only stores the data in a
.csvfile (usingstd::ofstream). The plotting is then done by a python script that reads this.csvfile. The python script is called within the C++ code via thestd::system(...)function. See e.g.BurgersEquation.
Only work in ./developers/<ProblemName>/. This folder needs to contain at least:
CMakeLists.txt(same for every problem, so just copy-paste it from another problem)mastersolution/(contains you code, with tags as described below)mastersolution/dependencies.cmake(contains the info needed by the build system, just mimic the ones from other problems) Every problem should contain unit test in the directorymastersolution/test/containing the following two files:problemname_test.cc(contains the unit tests for your code)dependencies.cmake(contains the info needed by the build system, just mimic the ones from other test directories) In addition, if a problem needs to load meshes, we put them in the folder./developers/<ProblemName>/meshes/. Finally, the lineadd_subdirectory(<ProblemName>)has to be added in./developers/CMakeLists.txt.
In the files of ./developers/mastersolution/ we put the following tags
#if SOLUTION
<only in mastersolution>
#else
<only in template>
#endif
to indicate what belongs to mastersolution and/or template. Based on these tags, the file ./scripts/deploy_npde.py generates a directory ./homeworks/<ProblemName>/ containg the directories mastersolution, mysolution, temaplates with the corresponding content. The students work exclusively in ./homeworks/<ProblemName>/.
BoundaryWave: mysolution has core dumpCoupledSecondOrderBVP: needs solution tagsLaxWendroffScheme: unit test of mastersolution takes too long (Oliver)PointEvaluationRhs: bad includes (Liaowang)RadauThreeTimestepping: mysolution has core dump and mastersolution not returning same sol anymore?SDIRKMethodOfLines: mysolution has core dumpSimpleLinearFiniteElements: bad includes (Amélie)
Problems PDF: https://www.sam.math.ethz.ch/~grsam/NUMPDE/HOMEWORK/NPDEProblems.pdf
- Problem 4.1: Finite Volumes with Robin Boundary Conditions (Philippe)
- Problem 5.6: Parametric Finite Elements
- Problem 5.7: Stable Evaluation at a Point
- Problem 5.8: Trace Error Estimates (done already?)
- Problem 6.6: Non-linear Schrödinger Equation with Cubic Non-Linearity (Oliver)
- Problem 7.3: Upwind Quadrature
- Problem 7.4: Exponentially fitted upwind scheme
- Problem 7.5: Transport Problem
- Problem 7.6: Upwind Finite Volume Method