Basic questions: Setting up a test case and running it

399 views
Skip to first unread message

Ravi Challa

unread,
Mar 3, 2022, 10:21:19 AM3/3/22
to ProjectChrono
Hi,

I am new to Project Chrono (PC) community and I have a few basic questions.

With an overarching goal of modeling FSI problems, I successfully installed PC following all the instructions provided in the link below:

However, I am not sure how to proceed after this. Kind of stuck. For example, I want to test a simple Finite Element problem shown here:
Test #1 for example:

I have Visual Studi0 2022 and CMake installed and I was hoping someone can walk me through how to open a test case, edit, and, run the code to view results. (Step-by-step procedure to successfully use the installed tools to debug and post-process results).

Thanks for your attention. I’m looking forward to your reply.

Ravi

Radu Serban

unread,
Mar 3, 2022, 10:56:17 AM3/3/22
to ProjectChrono

Hi Ravi,

 

All Chrono modules are so-called middleware.  This means that we do not provide a main function, but rather you write your own and make calls to Chrono functions to model and simulate your system.

 

Having said that, Chrono comes with a fairly large number of demo programs.  These are programs that do provide such a main function and, once built, they result in an executable which you can run.   These demos constitute both a good way of learning about Chrono and its usage, as well as good starting points for your own Chrono-based projects.

 

If you say you were able to configure, build, and install the Chrono code, you should have all you need, including these demos.  When using Visual Studio as the generator for CMake, you will get a VS solution file in the build directory.  Again, if you say you built and install Chrono, you already used that sln file.  Note that this VS solution has many projects, including some that have names starting with “demo_”.  Set one of those as “starting project” in VS and run it from within VS.  You can modify the demo source however you want, rebuild it and see the effects.

 

The demo you refer to in particular, is a project in that VS solution named ‘demo_FEA_basic’.

 

Hope that this helps,
--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/3208ae54-f2ce-4cbb-bfa4-7e81e2c056a0n%40googlegroups.com.

Ravi Challa

unread,
Mar 4, 2022, 11:09:41 PM3/4/22
to ProjectChrono
Hi Radu,

Thank you for your input. It helped me successfully run the first "demo_FEA_basic" project.
As a next step, I wanted to build/test a Chrono FSI project ->  "demo_FSI_DamBreak" that comes with the package.
(This is the FSI demo project located in: workspace>chrono>src>demos>fsi).

Please note:
I copied the CMakeLists along with the "demo_FSI_DamBreak.cpp" from the folder mentioned above to the "my_fsi_project" folder and I modified the CMakeLists based on the template file to include the project name, postprocessor modules, etc.,

However, during the Chrono project build process, I encountered an error whilst configuring CMake.

Error:
CMake Error at CMakeLists.txt: 119 (CUDA AND EXECUTABLE):
      Unknown CMake command "CUDA_ADD_EXECUTABLE".


There are a few things amiss in the CMakeLists file. I also see that I am not invoking the Chrono FSI in the CMake build process (?).
For convenience, please find attached a copy of the CMake list used to build the FSI project along with a PDF of the workflow.

Can you please let me know how to go about fixing this error or any missing steps in the CMakeLists?

Thank you in advance for your time and help.
Ravi
CMakeLists.zip
PC FSI Demo RC 3-4-22.pdf

Ravi Challa

unread,
Mar 5, 2022, 9:47:09 AM3/5/22
to ProjectChrono
Adding to my previous post:

I did a little bit of debugging to figure out a solution and as a part of the process I took a step back and tried to reconfigure CMake (Step 7 in https://api.projectchrono.org/tutorial_install_chrono.html) to check:
(1) if I checked "ENABLE_MODULE_FSI"
(2) if CUDA toolkit was installed.

When I checked the  "ENABLE_MODULE_FSI" box and tried to reconfigure, it did not complete the configuration process (FAIL). 
See a snippet from CMake log below.

***********************************************************************************

==== Submodules ====

Build Google test framework

Google test code not found: update git submodules.

Building of unit tests was disabled.

==== Chrono Engine core module ====

==== Chrono Irrlicht module ====

==== Chrono Postprocess module ====

==== Chrono Vehicle module ====

==== Chrono FSI module ====

CMake Warning at src/chrono_fsi/CMakeLists.txt:26 (message):
Chrono::FSI requires CUDA, but CUDA was not found; disabling Chrono::FSI

***********************************************************************************

Do I need to install CUDA separately to enable Chrono:: FSI? If yes, please point me to a source. If not, why is it missing in the CMake configuration?

Please see the attached/updated PDF for my FSI project workflow.

Thanks for your time and help.
Ravi

PC FSI Demo RC 3-5-22.pdf

Radu Serban

unread,
Mar 6, 2022, 1:45:43 PM3/6/22
to ProjectChrono

Yes, you need CUDA for the Chrono::FSI module. 

CUDA is available from NVIDIA (https://developer.nvidia.com/cuda-zone).  Of course, you must have an NVIDIA GPU, as mentioned in the Chrono::FSI installation page.

Ravi Challa

unread,
Mar 6, 2022, 2:38:57 PM3/6/22
to ProjectChrono
Thank you for your response. I did realize that yesterday and I installed CUDA from the website you mentioned. However, I continue to get the same error message:

CMake Error at CMakeLists.txt:95 (CUDA_ADD_EXECUTABLE):

Unknown CMake command "CUDA_ADD_EXECUTABLE".

Background:
1. Installed CUDA (NVIDIA).
2. When I go to the workspace>chrono build>bin>release folder, and double click on the demos for FSI DamBreak/FSI Poiseuille flow, they seem to run.
3. As a next step, I created my own fsi project by copying the CMakeLists and let's say one of the fsi .cpp files from workspace>chrono>src>demos>fsi to "my_fsi_project" folder to configure and generate my_fsi_project_buid.
4. I modified the CMakeLists before configuring to include the cmake configuration version, project name, and other dependencies.

Either the CUDA is not installed properly or there is something missing/wrong with the modified CMakeLists.

Can you please take a look at the CMakeLists and provide your feedback. Somehow it doesn't recognize the CUDA installation (?).

For convenience I uploaded the CMakeLists and my fsi project files to my google shared drive and the link is as follows:

Thanks for your time and input.
Ravi

Radu Serban

unread,
Mar 6, 2022, 3:21:01 PM3/6/22
to ProjectChrono

Ravi,

 

Please read carefully through the instructions at https://api.projectchrono.org/tutorial_install_project.html and note that you must *add* as components to the CMake find_package command any and all Chrono modules you want to use in your project.   Your CMakeLists.txt file does not request the FSI module.

 

Please also look at the projects in the chrono-projects repository (https://github.com/projectchrono/chrono-projects) for examples of linking to and using various Chrono modules in external projects.  In particular, the example in https://github.com/projectchrono/chrono-projects/tree/develop/configuration_tests/fsi.

Ravi Challa

unread,
Mar 7, 2022, 8:52:13 AM3/7/22
to ProjectChrono
Radu, 

Thank you for your suggestion. Apart from the missing commands in the CMakeLists.txt (to invoke FSI) I also noticed that the CUDA package is not installed properly as well. I will reinstall CUDA and also go through the instructions to create a proper CMake for my FSI project.

Kindly,
Ravi

Ravi Challa

unread,
Mar 12, 2022, 12:31:06 AM3/12/22
to ProjectChrono
Radu,

I get the following error message whilst building the solution (in release mode) for the "demo_FSI_cylinderDrop" FSI problem.
It complains of a few components not a member of the chrono::fsi::ChSystemFsi system (please see error message below).

Can you please take a look at the attached CMakeLists file and provide your comments.

Thank you for your time and help.
Ravi

PS
Build started...
1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>Checking Build System
2>------ Build started: Project: myexe, Configuration: Release x64 ------
3>------ Build started: Project: COPY_DLLS, Configuration: Release x64 ------
2>Building Custom Rule C:/workspace/my_fsi_project/CMakeLists.txt
2>demo_FSI_cylinderDrop.cpp
3>Building Custom Rule C:/workspace/my_fsi_project/CMakeLists.txt
2>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include\cub/detail/device_synchronize.cuh(33,9): warning C4068: unknown pragma 'nv_exec_check_disable'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(159,21): error C2039: 'PrintParticleToFile': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(229,17): error C2039: 'AddBceBox': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(230,17): error C2039: 'AddBceBox': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(231,17): error C2039: 'AddBceBox': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(232,17): error C2039: 'AddBceBox': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(233,17): error C2039: 'AddBceBox': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(234,17): error C2039: 'AddBceBox': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(268,17): error C2039: 'AddBceCylinder': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(294,17): error C2039: 'SetSimParameter': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(313,17): error C2039: 'SetBoundaries': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(320,17): error C2039: 'SetSubDomain': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(323,17): error C2039: 'SetFsiOutputDir': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(338,21): error C2039: 'AddSphMarker': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\my_fsi_project\demo_FSI_cylinderDrop.cpp(341,17): error C2039: 'AddRefArray': is not a member of 'chrono::fsi::ChSystemFsi'
2>C:\workspace\chrono\src\chrono_fsi/ChSystemFsi.h(54): message : see declaration of 'chrono::fsi::ChSystemFsi'
2>Done building project "myexe.vcxproj" -- FAILED.
4>------ Skipped Build: Project: ALL_BUILD, Configuration: Release x64 ------
4>Project not selected to build for this solution configuration
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 1 skipped ==========
CMakeLists.zip

Radu Serban

unread,
Mar 12, 2022, 4:30:25 AM3/12/22
to ProjectChrono

Ravi – I had already suggested you look in the chrono-projects repository for examples of configuring Chrono modules as external libraries for your project.

 

Nobody can tell where your issue is by just looking at the CMakeLists, but:

  1. Make sure you first build Chrono with all necessary modules enabled.
  2. In your project CMakeLists, invoke find_package(Chrono …) only once, passing all required and optional components.
  3. After finding Chrono, the configuration script prints out information about the requested and optional components, which ones were found, and the variables that were set.  Make sure those match what you expect
Reply all
Reply to author
Forward
0 new messages