Time flies when you are solving problems or at least trying. After the feedback from my mentors regarding the first week, I was able to go deeper into the code and understand more day after day. My mentors have been really helpful with fast feedback. This second week, long emails were exchange in order to get more information about the tool and the tasks.
The following is a description what I have done.
The final goal of the project is to automatically add masses for the beam element. As stated by Marco Morandini, the roadmap to add this feature for MBDyn is composed by:
beam3:
all the required data already specified for a beam,
automatic mass,
value_of_density_per_unit_length, mass offset (a vector), # node 1
value_of_density_per_unit_length, mass offset (a vector), # node 2
value_of_density_per_unit_length, mass offset (a vector); # node 3
or
beam3:
all the required data already specified for a beam,
automatic mass,
value_of_density_per_unit_length, mass offset (a vector), # node 1
same, # node 2
same; # node 3
So far this week, I have completed the parsing inputs (which is located at beam.cc). I am able to read the input file (modified cantilever1 example) and have extracted the expected information. This coming week I will continue on adding the new body. For achieving this task, I will be studying the body.c file. So far, I have already obtained several information from Marco, which will make it easier to adapt this code for the beam.
As already mentioned in previous posts, I created a repository for gathering software, files and materials used in this coding period. This week I added the fresh repository and I already pushed the working modifications I have worked on this week.
To get the latest updates as they come, download my current software from git. To download the repository execute the following from the command line:
git clone git@github.com:EriveltonGualter/GSoC-MBDyn.git
To update to the latest version, go into your repository and execute:
git pull origin master
The code is located under the folder mbdyn-develop.
As mentioned in the last post, I have been using gdb debugger. It was really useful in the beginning. However, Rafael Mudafort, one of the users of MBDyn, shared his launch configuration for VSCode here: https://public.gitlab.polimi.it/DAER/mbdyn/issues/19. I was able to modify it for my specifications. The following corresponds to the launch configuration for Visual Studio Code on Ubuntu 18.04:
{
"version": "0.2.0",
"configurations": [
{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/mbdyn/mbdyn",
"args": [],
"stopAtEntry": false,
"cwd": "/home/erivelton/GSoC2019/GSoC-MBDyn/Beam Scripts/",
"args": ["-fcantilever1.mbd"],
"stopAtEntry": false,
"externalConsole": false,
"MIMode": "gdb"
}
]
}
and here is the task launch:
{
"tasks": [
{
"type": "shell",
"label": "cpp build active file",
"command": "/usr/bin/cpp",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
}
},
{
"type": "shell",
"label": "g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
}
}
],
"version": "2.0.0"
}
More information about configuring the launch file can be found here: https://github.com/microsoft/vscode-cpptools/blob/master/launch.md/.