|
MPS-Basic
|
build directory (mkdir build) and move to the directory (cd build), thanks to the -B build option. The build directory will be automatically generated if you don't have one.(1). Execution Command
The execution command consists of three parts.
--setting or -s specifies the setting file.--output or -o specifies the output directory.(2). Standard (Error) Output
The output of a c++ program includes standard output and standard error output. The standard output comes from std::cout or printf(), while the standard error output comes from std::cerr or fprintf(stderr, ). By default, both the standard output and the standard error output will be shown in the console. Changing the output destination is called "redirect", and can be accomplished with the > command.
For example, the standard output of the command below will be written to result.log. The standard error output will be shown in the console as usual.
In the next example, the standard output will be written to result.log, and the standard error output will be written to error.log.
(2). tee command
tee command allows us to show the standard output in the console and save them into a file at the same time.
it sends the output of a command in two directions (like the letter T)
Foe example, the standard output of the command below will be shown in the console and will be written to result.log at the same time.
Script files are prepared in the scripts folder. You can just call it for execution.
Windows
Linux/Mac
Configure to ReleaseBuild
Launch button on the CMake tab. It will launch the program in a wrong directory, and it won't delete existing files.tasks to do it easily..vscode/tasks.json file.
Ctrl + Shift + P or F1). Search and execute Tasks: Run Test Task. It does the same thing as calling the script in the terminal.
Preferences: Keyboard Shortcuts. Search Tasks: Run Test Task and set any keybinding you want. Ctrl + Shift + T is a suggestion of the writer.
Result files will be written in result/dambreak/vtu/***.vtu. Open these files in ParaView to see the result.
Configure to DebugDebug
launch button in the previous section, the debug button will execute the code in the correct directory. Also, there is no need to delete existing files when debugging. So you can just press it this time.