Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: unconfirmed bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- OpenFLUID version [e.g. 2.1.11]

**Additional context**
Add any other context about the problem here.
8 changes: 1 addition & 7 deletions .github/workflows/CI-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ jobs:
gnuplot
- name: Installation of pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Installation of latex
uses: teatimeguest/setup-texlive-action@v3
with:
packages: |
scheme-full
bibtex
- name: Checkout of source code
uses: actions/checkout@v3
- name: Preparation
run: |
echo "$(brew --prefix qt6)/bin" >> $GITHUB_PATH
mkdir ./_build
- name: Configuration
run: cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt6)/lib/cmake
run: cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt6)/lib/cmake -DOFBUILD_ENABLE_DOCS=OFF
working-directory: ./_build
- name: Build
run: make -j 2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:


ci-windows-debug:
runs-on: windows-2019
runs-on: windows-2025

defaults:
run:
Expand All @@ -25,7 +25,7 @@ jobs:
release: false
install: >-
mingw-w64-x86_64-toolchain mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-fortran
mingw-w64-x86_64-cmake mingw-w64-x86_64-doxygen
mingw-w64-x86_64-cmake mingw-w64-x86_64-doxygen make
mingw-w64-x86_64-boost mingw-w64-x86_64-gdal mingw-w64-x86_64-curl-winssl
mingw-w64-x86_64-qt5 mingw-w64-x86_64-openssl
git p7zip mingw-w64-x86_64-gnuplot mingw-w64-x86_64-graphviz
Expand Down
7 changes: 4 additions & 3 deletions CMake.in.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#
# Configuration file for CMakeLists.txt files
#
# Author : Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
# Authors : Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
# Armel THÖNI <armel.thoni@inrae.fr>
#
# This file is included by the main CMakeLists.txt file, and defines variables
# to configure the build and install
Expand All @@ -22,8 +23,8 @@ SET(OFBUILD_CUSTOM_CMAKE_VERSION "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.

SET(OPENFLUID_VERSION_MAJOR 2)
SET(OPENFLUID_VERSION_MINOR 2)
SET(OPENFLUID_VERSION_PATCH 0)
SET(OPENFLUID_VERSION_STATUS "") # example: SET(OPENFLUID_VERSION_STATUS "rc1")
SET(OPENFLUID_VERSION_PATCH 1)
SET(OPENFLUID_VERSION_STATUS "alpha6") # example: SET(OPENFLUID_VERSION_STATUS "rc1")

SET(OPENFLUID_VERSION_FULL "${OPENFLUID_VERSION_MAJOR}.${OPENFLUID_VERSION_MINOR}.${OPENFLUID_VERSION_PATCH}")

Expand Down
15 changes: 13 additions & 2 deletions cmake/OpenFLUIDTestScript.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ FUNCTION(EXECUTE_COMMAND CMD)
ENDIF()
FILE(REMOVE_RECURSE ${TMPDIR})

ELSEIF(${CMD} STREQUAL "CHECK_FILE_CONTAINS")
FILE(READ ${TMPDIR}/${ARGV1} TMPTXT)
STRING(FIND "${TMPTXT}" "${ARGV2}" ISMATCH)
IF(${ISMATCH} EQUAL -1)
MESSAGE(FATAL_ERROR "CHECK_FILE_CONTAINS: file ${ARGV1} does not contain string ${ARGV2}")
ENDIF()

ELSEIF(${CMD} STREQUAL "CHECK_FILE_IDENTICAL")
# generates consistent eol between files (can be replaced by option ignore_eol in cmake 3.14)
CONFIGURE_FILE(${ARGV1}${ARGV3} ${ARGV1}${ARGV3}_UNIX_EOL NEWLINE_STYLE UNIX)
Expand All @@ -73,6 +80,8 @@ FUNCTION(EXECUTE_COMMAND CMD)
IF(IS_DIRECTORY ${ARGV1})
MESSAGE(FATAL_ERROR "CHECK_DIRECTORY_NOT_EXISTING: directory ${ARGV1} found")
ENDIF()
ELSEIF(${CMD} STREQUAL "CREATE_DIRECTORY")
FILE(MAKE_DIRECTORY ${ARGV1})
ELSEIF(${CMD} STREQUAL "REMOVE_FILE")
IF(EXISTS ${ARGV1})
FILE(REMOVE ${ARGV1})
Expand Down Expand Up @@ -116,6 +125,7 @@ FUNCTION(PARSE_COMMANDS)
IF(${CMD_EXPECTED})
IF(${ELEM} STREQUAL "CHECK_FILE_EXIST" OR
${ELEM} STREQUAL "CHECK_FILE_EXIST_IN_ARCHIVE" OR
${ELEM} STREQUAL "CHECK_FILE_CONTAINS" OR
${ELEM} STREQUAL "CHECK_FILE_IDENTICAL" OR
${ELEM} STREQUAL "CHECK_DIRECTORY_EXIST" OR
${ELEM} STREQUAL "CHECK_DIRECTORY_NOT_EXISTING" OR
Expand All @@ -125,7 +135,7 @@ FUNCTION(PARSE_COMMANDS)
${ELEM} STREQUAL "COPY_DIRECTORY" OR
${ELEM} STREQUAL "EMPTY_DIRECTORY" OR
${ELEM} STREQUAL "CREATE_FILE" OR
${ELEM} STREQUAL "CREATE_DIR" OR
${ELEM} STREQUAL "CREATE_DIRECTORY" OR
${ELEM} STREQUAL "COMPARE_FILES" OR
${ELEM} STREQUAL "COMPARE_DIRECTORIES")
SET(CURRENT_CMD "${ELEM}")
Expand All @@ -141,6 +151,7 @@ FUNCTION(PARSE_COMMANDS)
ELSE()
IF(${CURRENT_CMD} STREQUAL "COMPARE_FILES" OR
${CURRENT_CMD} STREQUAL "CHECK_FILE_EXIST_IN_ARCHIVE" OR
${CURRENT_CMD} STREQUAL "CHECK_FILE_CONTAINS" OR
${CURRENT_CMD} STREQUAL "COMPARE_DIRECTORIES" OR
${CURRENT_CMD} STREQUAL "COPY_FILE" OR
${CURRENT_CMD} STREQUAL "COPY_DIRECTORY")
Expand Down Expand Up @@ -208,7 +219,7 @@ MESSAGE("TEST command: ${CMD}")
EXECUTE_PROCESS(COMMAND ${CMD}
RESULT_VARIABLE CMD_RESULT)
IF(CMD_RESULT)
MESSAGE(FATAL_ERROR "Test error")
MESSAGE(FATAL_ERROR "Test error: ${CMD_RESULT}")
ENDIF()


Expand Down
4 changes: 1 addition & 3 deletions doc/contents/dev_signature.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ Simulator parameters, variables and attributes are declared in the "simulator" p
### Simulator parameters {#dev_signature_data_simparams}

Simulator parameters are values provided to each simulator,
and are declared using the @if DocIsLaTeX **DECLARE_REQUIRED_PARAMETER** or **DECLARE_USED_PARAMETER**
@else DECLARE_REQUIRED_PARAMETER or DECLARE_USED_PARAMETER @endif
instructions.
and are declared in three blocks: "required", "used" or "produced".
These instructions takes 3 arguments

* the name of the parameter
Expand Down
9 changes: 9 additions & 0 deletions resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ IF(PYTHON3_EXECUTABLE)
"${CMAKE_SOURCE_DIR}"
)

# import ref wares from repositories
ADD_CUSTOM_TARGET(importwares
COMMENT "Copying reference wares from their remote repository"
COMMAND "${PYTHON3_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/tools/ofsrc-importwares.py"
"${CMAKE_CURRENT_SOURCE_DIR}/tools/wares-to-import.txt"
"${CMAKE_SOURCE_DIR}"
)

ENDIF()


Expand Down
12 changes: 12 additions & 0 deletions resources/tests/miscdata/SignatureSerializer/ref_sim.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
"description": "coefficient",
"siunit": "",
"type": ""
},
{
"name": "coeff 2",
"description": "coefficient with a space",
"siunit": "",
"type": ""
},
{
"name": "coeff&3",
"description": "coefficient with weïrd char",
"siunit": "",
"type": ""
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
"description": "coefficient",
"siunit": "",
"type": ""
},
{
"name": "coeff 2",
"description": "coefficient with a space",
"siunit": "",
"type": ""
},
{
"name": "coeff&3",
"description": "coefficient with weïrd char",
"siunit": "",
"type": ""
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
"description": "coefficient",
"siunit": "",
"type": ""
},
{
"name": "coeff 2",
"description": "coefficient with a space",
"siunit": "",
"type": ""
},
{
"name": "coeff&3",
"description": "coefficient with weïrd char",
"siunit": "",
"type": ""
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ INCLUDE(CMake.in.config)

FIND_PACKAGE(OpenFLUIDHelpers REQUIRED)

SET(CUSTOM_VAR foo)

OPENFLUID_ADD_SIMULATOR(SIM)

MESSAGE(STATUS "custom message")
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@
# This scripts imports simulators in a destination folder by specifying the git url and branch.
# It will then remove all git related files in simualors and potential fragments
#
# Usage: importsim.py /path/to/sims_text_file /path/to/destination_folder
# Usage: importwares.py /path/to/sims_text_file /path/to/destination_folder
#
# - sims_text_file: Text file where we specify the simulators to import on each lines of the file.
# A line must be written as follows :
# GitURL#branch_name clone_folder_name
# - /path/to/destination_folder: The destination folder path where all simulators are cloned
#
# When in openfluid root dir:
# `python3 resources/tools/ofsrc-importwares.py resources/tools/wares-to-import.txt .`

############################################################################


Expand Down Expand Up @@ -82,8 +85,10 @@ def clone_and_clean_repo(file_line, destination_path):
repo_name = file_line_split[1]
giturl_split = giturl_branch.split("#")

print("Processing "+repo_name.split("/")[-1]+"...")

if(len(giturl_split) != 2):
print("[ERROR] Wrong file format")
print(" [ERROR] Wrong file format")
return

git_url, git_branch = giturl_split
Expand All @@ -92,7 +97,7 @@ def clone_and_clean_repo(file_line, destination_path):
repo_path = os.path.join(destination_path, repo_name)

if(delete_folder(repo_path)):
print(repo_path + " deleted")
print(" " + repo_path + " deleted")


# Clone repo
Expand All @@ -103,10 +108,10 @@ def clone_and_clean_repo(file_line, destination_path):
text=True)

if clone_process.returncode != 0:
print("[ERROR] Could not clone git repo " + git_url)
print(" [ERROR] Could not clone git repo " + git_url)
return

print(repo_path + " successfullly cloned")
print(" " + repo_path + " successfully cloned")


# Checkout branch
Expand All @@ -117,10 +122,10 @@ def clone_and_clean_repo(file_line, destination_path):
text=True)

if branch_process.returncode != 0:
print("[ERROR] Could not checkout branch " + git_branch)
print(" [ERROR] Could not checkout branch " + git_branch)
return

print(git_branch + " successfullly checkout")
print(" " + git_branch + " successfully checkout")

# Update potential submodules
subprocess.run(["git", "submodule", "update", "--init", "--recursive"],
Expand All @@ -131,28 +136,28 @@ def clone_and_clean_repo(file_line, destination_path):
# Delete versionning files
git_folder = os.path.join(repo_path, ".git")
if(delete_folder(git_folder)):
print(git_folder + " deleted")
print(" " + git_folder + " deleted")

gitignore_file = os.path.join(repo_path, ".gitignore")
if(delete_file(gitignore_file)):
print(gitignore_file + " deleted")
print(" " + gitignore_file + " deleted")

# Check for submodules
git_submodules_file = os.path.join(repo_path, ".gitmodules")
if(delete_file(git_submodules_file)):
print(git_submodules_file + " deleted")
print(" " + git_submodules_file + " deleted")

# Loop through fragments
fragments_path = os.path.join(repo_path, "src", "fragments")
if(os.path.exists(fragments_path) and os.path.isdir(fragments_path)):
for fragment in os.listdir(fragments_path):
fragment_git_file = os.path.join(fragments_path, fragment, ".git")
if(delete_file(fragment_git_file)):
print(fragment_git_file + " deleted")
print(" " + fragment_git_file + " deleted")

fragment_gitignore_file = os.path.join(fragments_path, fragment, ".gitignore")
if(delete_file(fragment_gitignore_file)):
print(fragment_gitignore_file + " deleted")
print(" " + fragment_gitignore_file + " deleted")


# ===========================================================
Expand Down
17 changes: 9 additions & 8 deletions resources/tools/ofsrc-stylecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,16 @@ def checkHeaderGuard(self, Filename, Content):

ExpectedGuardName = '__OPENFLUID_'+MiddlePart+LastPart+'__'


if ExpectedGuardName:
Result = re.search( r'#ifndef '+re.escape(ExpectedGuardName)+'\s*\n#define '+re.escape(ExpectedGuardName), Content)
if not Result:
self.addProblem('HGRD',Filename,1,'missing or malformed header guard definition (expected',ExpectedGuardName+')')

Result = re.search( r'#endif /\* '+re.escape(ExpectedGuardName)+ r' \*/\s*\n', Content)
if not Result:
self.addProblem('HGRD',Filename,1,'missing or malformed header guard closing')
ResultPragma = re.search( r'#pragma once', Content)
if not ResultPragma:
Result = re.search( r'#ifndef '+re.escape(ExpectedGuardName)+'\s*\n#define '+re.escape(ExpectedGuardName), Content)
if not Result:
self.addProblem('HGRD',Filename,1,'missing or malformed header guard definition (expected',ExpectedGuardName+')')

Result = re.search( r'#endif /\* '+re.escape(ExpectedGuardName)+ r' \*/\s*\n', Content)
if not Result:
self.addProblem('HGRD',Filename,1,'missing or malformed header guard closing')



Expand Down
8 changes: 8 additions & 0 deletions resources/tools/wares-to-import.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
https://hub.openfluid-project.org/git-service/wares/simulators/water.surf.transfer-su.hayami#openfluid-2.2 examples/wares-dev/simulators/water.surf.transfer-su.hayami
https://hub.openfluid-project.org/git-service/wares/simulators/water.surf.transfer-rs.hayami#openfluid-2.2 examples/wares-dev/simulators/water.surf.transfer-rs.hayami
https://hub.openfluid-project.org/git-service/wares/simulators/water.atm-surf.rain-su.files#openfluid-2.2 examples/wares-dev/simulators/water.atm-surf.rain-su.files
https://hub.openfluid-project.org/git-service/wares/simulators/water.surf-uz.runoff-infiltration.mseytoux#openfluid-2.2 examples/wares-dev/simulators/water.surf-uz.runoff-infiltration.mseytoux
https://hub.openfluid-project.org/git-service/wares/observers/export.vars.files.csv#openfluid-2.2 src/observers/export.vars.files.csv
https://hub.openfluid-project.org/git-service/wares/observers/export.vars.files.csv-multicols#openfluid-2.2 src/observers/export.vars.files.csv-multicols
https://hub.openfluid-project.org/git-service/wares/observers/export.vars.files.kml-plot#openfluid-2.2 src/observers/export.vars.files.kml-plot
https://hub.openfluid-project.org/git-service/wares/observers/export.vars.files.kml-anim#openfluid-2.2 src/observers/export.vars.files.kml-anim
2 changes: 1 addition & 1 deletion share/openfluid/waresdev/cmake.syntaxhl.ofdev.xml
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@
<pattern value="\'[^\']*\'" />
</rule>

<rule name="comment" style="comment">
<rule name="comment-singleline" style="comment">
<pattern value="#.*$" />
</rule>

Expand Down
Loading
Loading