Skip to content

Commit

Permalink
Merge branch 'thirdparty-cleanup' into 'master'
Browse files Browse the repository at this point in the history
Removed ThirdParty-folder

See merge request ogs/ogs!4974
  • Loading branch information
endJunction committed Apr 15, 2024
2 parents 443a4fd + e180f23 commit f0096cd
Show file tree
Hide file tree
Showing 27 changed files with 391 additions and 845 deletions.
1 change: 0 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: "2"
exclude_patterns:
- "ThirdParty/"
- "Tests/"
plugins:
duplication:
Expand Down
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[codespell]
skip = *.bib,*.css,*.pdf,*.yaml,*.yml,*/.vale,./.git,./GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd,./Tests/Data,./ThirdParty,./web/content/imprint.md,./web/node_modules,./web/public/imprint/index.html,./web/resources,CITATION.cff,
skip = *.bib,*.css,*.pdf,*.yaml,*.yml,*/.vale,./.git,./GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd,./Tests/Data,./web/content/imprint.md,./web/node_modules,./web/public/imprint/index.html,./web/resources,CITATION.cff,
ignore-words-list = ba,bu,ket,nd,pris,strat,sur,theis,
exclude-file = .codespellexclude
uri-ignore-words-list = *
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Tests/Data/_out
web/.netlify

CMakeUserPresets.json
scripts/cmake/vtk-*.patch

.snakemake

Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "ThirdParty/ogs6py"]
path = ThirdParty/ogs6py
url = https://github.com/joergbuchwald/ogs6py.git
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md, --markdown-linebreak-ext=pandoc]
exclude: "^ThirdParty/.*|^Tests/Data/.*|^web/static|^Documentation/.vale/.*|.*\\.patch"
exclude: "^Tests/Data/.*|^web/static|^Documentation/.vale/.*|.*\\.patch"
- id: check-added-large-files
args: [--maxkb 1024]
- id: check-merge-conflict
Expand All @@ -24,7 +24,7 @@ repos:
rev: 23.1.0
hooks:
- id: black
exclude: "ThirdParty|LinearMFront/generate_ref.py"
exclude: "LinearMFront/generate_ref.py"
# Run black on markdown notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
Expand All @@ -35,7 +35,7 @@ repos:
rev: v2.2.2
hooks:
- id: codespell
exclude: 'ThirdParty/.*|Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*|.*\.ipynb|.*\.svg'
exclude: 'Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*|.*\.ipynb|.*\.svg'
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
Expand All @@ -56,7 +56,7 @@ repos:
name: Run git diff --check
entry: git diff --check --cached -- ':!*.md' ':!*.pandoc' ':!*.asc' ':!*.dat' ':!*.ts'
language: system
exclude: "ThirdParty/.*|Tests/Data/.*|web/static/images/xsd"
exclude: "Tests/Data/.*|web/static/images/xsd"
stages: [commit, manual]
- id: file-extensions
name: Check file extensions
Expand Down
16 changes: 8 additions & 8 deletions Applications/Utils/MeshEdit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ set(TOOLS

add_subdirectory(PVTU2VTU)

ogs_add_executable(
RemoveGhostData RemoveGhostData.cpp
${PROJECT_SOURCE_DIR}/ThirdParty/paraview/vtkCleanUnstructuredGrid.cpp
)
target_include_directories(
RemoveGhostData PRIVATE ${PROJECT_SOURCE_DIR}/ThirdParty/paraview
)
ogs_add_executable(RemoveGhostData RemoveGhostData.cpp)
target_link_libraries(
RemoveGhostData GitInfoLib MeshLib MeshToolsLib tclap VTK::FiltersParallel
RemoveGhostData
GitInfoLib
MeshLib
MeshToolsLib
tclap
VTK::FiltersParallel
VTK::FiltersGeneral
)
install(TARGETS RemoveGhostData RUNTIME DESTINATION bin)

Expand Down
11 changes: 4 additions & 7 deletions ProcessLib/HT/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,10 @@ AddTest(
ThermalConvection_ts_1_t_0.000000_expected.vtu ThermalConvection_ts_1_t_0.000000.vtu darcy_velocity darcy_velocity 1e-8 1e-13
)

if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python_FOUND)
add_custom_target(generate_invalid_project_files_ht
${Python_EXECUTABLE}
${PROJECT_SOURCE_DIR}/ThirdParty/ogs6py/generateInvalidMediaForHT.py
generateInvalidMediaForHT.py
WORKING_DIRECTORY ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/)
if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND OGS_USE_PIP)
execute_process(COMMAND ${Python_EXECUTABLE}
${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/generateInvalidMediaForHT.py
WORKING_DIRECTORY ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles)
file(GLOB HT_INVALID_PRJ_FILES ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/*.prj)
foreach(ht_invalid_prj_file ${HT_INVALID_PRJ_FILES})
string(REPLACE ${Data_SOURCE_DIR}/Parabolic/HT/InvalidProjectFiles/HT "invalid" ht_invalid_prj_file_short ${ht_invalid_prj_file})
Expand All @@ -372,7 +370,6 @@ if(NOT OGS_USE_MPI AND OGS_BUILD_TESTING AND Python_FOUND)
EXECUTABLE ogs
EXECUTABLE_ARGS ${ht_invalid_prj_file}
RUNTIME 1
DEPENDS generate_invalid_project_files_ht
)
set_tests_properties(ogs-HT_${ht_invalid_prj_file_short} PROPERTIES WILL_FAIL TRUE)
endforeach()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
from ogs6py import ogs


def addSolidPropertiesForHT(omit=""):
if omit != "storage":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="storage",
type="Constant",
value="0.0",
)
if omit != "density":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="density",
type="Constant",
value="0.0",
)
if omit != "thermal_conductivity":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="thermal_conductivity",
type="Constant",
value="3.0",
)
if omit != "specific_heat_capacity":
model.media.add_property(
medium_id="0",
phase_type="Solid",
name="specific_heat_capacity",
type="Constant",
value="0.0",
)


def addAqueousLiquidPropertiesForHT(omit=""):
if omit != "specific_heat_capacity":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="specific_heat_capacity",
type="Constant",
value="0.0",
)
if omit != "thermal_conductivity":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="thermal_conductivity",
type="Constant",
value="0.65",
)
if omit != "density":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="density",
type="Constant",
value="1e-3",
)
if omit != "viscosity":
model.media.add_property(
medium_id="0",
phase_type="AqueousLiquid",
name="viscosity",
type="Constant",
value="1e-3",
)


def addMediumPropertiesForHT(omit=""):
if omit != "thermal_longitudinal_dispersivity":
model.media.add_property(
medium_id="0",
name="thermal_longitudinal_dispersivity",
type="Constant",
value="0.0",
)
if omit != "thermal_transversal_dispersivity":
model.media.add_property(
medium_id="0",
name="thermal_transversal_dispersivity",
type="Constant",
value="0.0",
)
if omit != "permeability":
model.media.add_property(
medium_id="0", name="permeability", type="Constant", value="1e-14 0 0 1e-14"
)
if omit != "porosity":
model.media.add_property(
medium_id="0", name="porosity", type="Constant", value="1e-3"
)


solid_properties = [
"",
"storage",
"density",
"thermal_conductivity",
"specific_heat_capacity",
]
aqueousfluid_properties = [
"",
"specific_heat_capacity",
"thermal_conductivity",
"density",
"viscosity",
]
medium_properties = [
"",
"thermal_longitudinal_dispersivity",
"thermal_transversal_dispersivity",
"permeability",
"porosity",
]

for solid_property in solid_properties:
for aqueousfluid_property in aqueousfluid_properties:
for medium_property in medium_properties:
if (
solid_property == ""
and aqueousfluid_property == ""
and medium_property == ""
):
continue
model = ogs.OGS(
PROJECT_FILE="HT_"
+ solid_property
+ "_"
+ aqueousfluid_property
+ "_"
+ medium_property
+ ".prj"
)
model.mesh.add_mesh(filename="square_1x1_quad_1e3.vtu")
model.geo.add_geom(filename="square_1x1.gml")
model.processes.set_process(
name="HT", type="HT", integration_order="2", specific_body_force="0 0"
)
model.processes.add_process_variable(
process_variable="temperature", process_variable_name="temperature"
)
model.processes.add_process_variable(
process_variable="pressure", process_variable_name="pressure"
)
model.processes.add_process_variable(
secondary_variable="darcy_velocity", output_name="darcy_velocity"
)

addAqueousLiquidPropertiesForHT(aqueousfluid_property)
addSolidPropertiesForHT(solid_property)
addMediumPropertiesForHT(medium_property)

model.timeloop.add_process(
process="HT",
nonlinear_solver_name="basic_picard",
convergence_type="DeltaX",
norm_type="NORM2",
abstol="1e-15",
time_discretization="BackwardEuler",
)
model.timeloop.set_stepping(
process="HT",
type="FixedTimeStepping",
t_initial="0",
t_end="1",
repeat="4",
delta_t="0.25",
)
model.timeloop.add_output(
type="VTK",
prefix="HT_test_",
repeat="1",
each_steps="10",
variables=["temperature", "pressure"],
)
model.parameters.add_parameter(name="T0", type="Constant", value="0")
model.parameters.add_parameter(name="P0", type="Constant", value="0")
model.parameters.add_parameter(
name="p_Dirichlet_left", type="Constant", value="1"
)
# model.parameters.add_parameter(name="p_Dirichlet_right", type="Constant", value="-1")
model.parameters.add_parameter(
name="t_Dirichlet_bottom", type="Constant", value="2"
)
# model.parameters.add_parameter(name="t_Dirichlet_top", type="Constant", value="1")
model.processvars.set_ic(
process_variable_name="temperature",
components="1",
order="1",
initial_condition="T0",
)
model.processvars.add_bc(
process_variable_name="temperature",
geometrical_set="square_1x1_geometry",
geometry="bottom",
type="Dirichlet",
component="0",
parameter="t_Dirichlet_bottom",
)
# model.processvars.add_bc(process_variable_name="temperature",
# geometrical_set="square_1x1_geometry",
# geometry="top",
# type="Dirichlet",
# component="1",
# parameter="t_Dirichlet_top")
model.processvars.set_ic(
process_variable_name="pressure",
components="1",
order="1",
initial_condition="P0",
)
model.processvars.add_bc(
process_variable_name="pressure",
geometrical_set="square_1x1_geometry",
geometry="left",
type="Dirichlet",
component="1",
parameter="p_Dirichlet_left",
)
# model.processvars.addadd_bcBC(process_variable_name="pressure",
# geometrical_set="square_1x1_geometry",
# geometry="right",
# type="Dirichlet",
# component="1",
# parameter="p_Dirichlet_right")
model.nonlinsolvers.add_non_lin_solver(
name="basic_picard",
type="Picard",
max_iter="4",
linear_solver="general_linear_solver",
)
model.linsolvers.add_lin_solver(
name="general_linear_solver",
kind="lis",
solver_type="cg",
precon_type="jacobi",
max_iteration_step="10000",
error_tolerance="1e-16",
)
model.linsolvers.add_lin_solver(
name="general_linear_solver",
kind="eigen",
solver_type="CG",
precon_type="DIAGONAL",
max_iteration_step="10000",
error_tolerance="1e-16",
)
model.linsolvers.add_lin_solver(
name="general_linear_solver",
kind="petsc",
solver_type="cg",
precon_type="bjacobi",
max_iteration_step="10000",
error_tolerance="1e-16",
prefix="foo",
)
model.write_input()
6 changes: 0 additions & 6 deletions ThirdParty/.clang-tidy

This file was deleted.

Loading

0 comments on commit f0096cd

Please sign in to comment.