The C++ Quick Start example in doc/sphinx/source/intros/gettingstarted.md is presented as a complete int main() program labeled transport1D.cpp, but it cannot compile.
The time-integration loop uses three variables that the snippet never declares:
for (int i = 0; i <= iter; i++) { // iter undeclared
C += dt * (D * (dis * (G * C)) - ...); // dt and dis undeclared
}
It also never sets initial conditions, so even after fixing the declarations C and V stay zero and the output is meaningless.
The real example it points to, examples/cpp/transport1D.cpp, declares iter, dt, dis, vel, R, C0, sets C(0) = C0 and V.fill(vel), and applies the retardation/dispersion scaling. A reader who copies the documented snippet gets compile errors on the very first program in the guide.
Suggested fix: align the snippet with the actual transport1D.cpp so it is self-contained and compiles.
The C++ Quick Start example in
doc/sphinx/source/intros/gettingstarted.mdis presented as a completeint main()program labeledtransport1D.cpp, but it cannot compile.The time-integration loop uses three variables that the snippet never declares:
It also never sets initial conditions, so even after fixing the declarations
CandVstay zero and the output is meaningless.The real example it points to,
examples/cpp/transport1D.cpp, declaresiter,dt,dis,vel,R,C0, setsC(0) = C0andV.fill(vel), and applies the retardation/dispersion scaling. A reader who copies the documented snippet gets compile errors on the very first program in the guide.Suggested fix: align the snippet with the actual
transport1D.cppso it is self-contained and compiles.