Skip to content
Snippets Groups Projects
Commit 6e85babd authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

Merge branch 'win-enable-th2m' into 'master'

[ci] Re-enable TH2M on Windows.

See merge request ogs/ogs!4757
parents 4aea7bcc a921bffe
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ jobs: ...@@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Configure CMake - name: Configure CMake
run: cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DOGS_BUILD_PROCESS_TH2M=OFF -DOGS_USE_UNITY_BUILDS=OFF -DOGS_BUILD_TESTING=OFF -DOGS_ENABLE_ELEMENT_PRISM=OFF -DOGS_ENABLE_ELEMENT_PYRAMID=OFF -DOGS_MAX_ELEMENT_DIM=2 run: cmake -B ${{ env.build }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DOGS_USE_UNITY_BUILDS=OFF -DOGS_BUILD_TESTING=OFF -DOGS_ENABLE_ELEMENT_PRISM=OFF -DOGS_ENABLE_ELEMENT_PYRAMID=OFF -DOGS_MAX_ELEMENT_DIM=2
# Build is not required unless generated source files are used # Build is not required unless generated source files are used
# - name: Build CMake # - name: Build CMake
......
...@@ -29,15 +29,20 @@ ...@@ -29,15 +29,20 @@
namespace namespace
{ {
std::size_t readMaterialID(std::istream& in) int readMaterialID(std::istream& in)
{ {
unsigned index; unsigned index;
unsigned material_id; unsigned material_id;
if (!(in >> index >> material_id))
if (!(in >> index >> material_id) ||
material_id > static_cast<unsigned>(std::numeric_limits<int>::max()))
{ {
return std::numeric_limits<std::size_t>::max(); // If read incorrectly or the material_id is not safely convertible to
// int.
return std::numeric_limits<int>::max();
} }
return material_id; // Safe conversion was checked above.
return static_cast<int>(material_id);
} }
MeshLib::Element* readElement(std::istream& in, MeshLib::Element* readElement(std::istream& in,
...@@ -289,7 +294,7 @@ MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name) ...@@ -289,7 +294,7 @@ MeshLib::Mesh* MeshIO::loadMeshFromFile(const std::string& file_name)
{ {
std::vector<MeshLib::Node*> nodes; std::vector<MeshLib::Node*> nodes;
std::vector<MeshLib::Element*> elements; std::vector<MeshLib::Element*> elements;
std::vector<std::size_t> materials; std::vector<int> materials;
while (!in.eof()) while (!in.eof())
{ {
......
...@@ -81,7 +81,7 @@ void zeroMeshFieldDataByMaterialIDs( ...@@ -81,7 +81,7 @@ void zeroMeshFieldDataByMaterialIDs(
std::transform(element_ip_data_offsets.begin(), std::transform(element_ip_data_offsets.begin(),
element_ip_data_offsets.end(), element_ip_data_offsets.end(),
element_ip_data_offsets.begin(), element_ip_data_offsets.begin(),
[n = n_components](double const v) [n = n_components](std::size_t const v)
{ return v / n; }); { return v / n; });
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <string>
#include <vector> #include <vector>
namespace BaseLib namespace BaseLib
......
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
<type>PerComponentDeltaX</type> <type>PerComponentDeltaX</type>
<norm_type>NORM2</norm_type> <norm_type>NORM2</norm_type>
<abstols>1e-15 1e-15 1e-05 1e-05 1.e-05</abstols> <abstols>1e-15 1e-15 1e-05 1e-05 1.e-05</abstols>
<reltols>1e-12 1e-12 1e-15 1e-10 1.e-10</reltols> <reltols>1e-12 1e-11 1e-15 1e-10 1.e-10</reltols>
</convergence_criterion> </convergence_criterion>
<time_discretization> <time_discretization>
<type>BackwardEuler</type> <type>BackwardEuler</type>
......
...@@ -78,7 +78,6 @@ environment-pass = [ ...@@ -78,7 +78,6 @@ environment-pass = [
# maybe this should be moved to CMake logic, i.e. disabling both features on win # maybe this should be moved to CMake logic, i.e. disabling both features on win
[tool.cibuildwheel.windows.config-settings] [tool.cibuildwheel.windows.config-settings]
"cmake.define.OGS_USE_MFRONT" = "OFF" "cmake.define.OGS_USE_MFRONT" = "OFF"
"cmake.define.OGS_BUILD_PROCESS_TH2M" = "OFF"
# Generator needs to be set here, CMAKE_GENERATOR env var does not work. # Generator needs to be set here, CMAKE_GENERATOR env var does not work.
# Ninja generator does not select the host64 compiler. # Ninja generator does not select the host64 compiler.
"cmake.args" = "-G;Visual Studio 16 2019;--preset;wheel" "cmake.args" = "-G;Visual Studio 16 2019;--preset;wheel"
......
...@@ -5,7 +5,7 @@ build gui win: ...@@ -5,7 +5,7 @@ build gui win:
rules: rules:
- if: '$CI_COMMIT_BRANCH == "master"' - if: '$CI_COMMIT_BRANCH == "master"'
variables: variables:
ADDITIONAL_CMAKE_ARGS: " -DOGS_BUILD_CLI=ON -DOGS_BUILD_PROCESS_TH2M=OFF" ADDITIONAL_CMAKE_ARGS: " -DOGS_BUILD_CLI=ON"
BUILD_TESTS: "false" BUILD_TESTS: "false"
BUILD_CTEST: "false" BUILD_CTEST: "false"
- if: $CI_COMMIT_BRANCH =~ /^v[0-9]\.[0-9]\.[0-9]/ - if: $CI_COMMIT_BRANCH =~ /^v[0-9]\.[0-9]\.[0-9]/
......
...@@ -5,12 +5,11 @@ build win: ...@@ -5,12 +5,11 @@ build win:
variables: variables:
CHECK_WARNINGS: "true" CHECK_WARNINGS: "true"
CMAKE_PRESET: release CMAKE_PRESET: release
# TODO: temporary switched off TH2M
CMAKE_ARGS: >- CMAKE_ARGS: >-
-DOGS_CI_TESTRUNNER_REPEAT=1 -DOGS_CI_TESTRUNNER_REPEAT=1
-DOGS_BUILD_PROCESS_TH2M=OFF
-DOGS_USE_PIP=ON -DOGS_USE_PIP=ON
-DOGS_USE_MKL=ON -DOGS_USE_MKL=ON
-DOGS_USE_UNITY_BUILDS=OFF
build win msvc: build win msvc:
extends: extends:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment