-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfix-petsc-slope-case' into 'master'
Fix a case when mfront would raise an exception and leave PetSc vectors in an unwanted state See merge request ogs/ogs!5096
- Loading branch information
Showing
81 changed files
with
14,235 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* \file | ||
* \copyright | ||
* Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org) | ||
* Distributed under a Modified BSD License. | ||
* See accompanying file LICENSE.txt or | ||
* http://www.opengeosys.org/project/license | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
namespace BaseLib::MPI | ||
{ | ||
|
||
#ifdef USE_PETSC | ||
// Reduce operations for interprocess communications while using Petsc | ||
static inline int reduceMin(int val) | ||
{ | ||
int result; | ||
MPI_Allreduce(&val, &result, 1, MPI_INTEGER, MPI_MIN, PETSC_COMM_WORLD); | ||
return result; | ||
} | ||
#else | ||
// Reduce operations for interprocess communications without using Petsc | ||
static inline int reduceMin(int val) | ||
{ | ||
return val; | ||
} | ||
#endif | ||
|
||
} // namespace BaseLib::MPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
|
||
#ifdef USE_PETSC | ||
#include <petscsystypes.h> | ||
|
||
#include "PETSc/PETScVector.h" | ||
#endif | ||
|
||
namespace MathLib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Instruction to generate this test case: | ||
|
||
gmsh -3 -format msh2 hexa_slope.geo | ||
msh2vtu -r hexa_slope.msh | ||
partmesh -i hexa_slope_domain.vtu --ogs2metis | ||
partmesh -n 4 -m -i hexa_slope_domain.vtu -- hexa_slope_physical_group*.vtu | ||
mpirun -n 4 ./soft/build/release-petsc/bin/ogs slope_hexa.prj | ||
|
72 changes: 72 additions & 0 deletions
72
Tests/Data/Mechanics/MohrCoulombAbboSloan/PetscMpi/hexa_slope.geo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
lc = 3.0; | ||
nh = 8; | ||
//+ | ||
Point(1) = {0, 0, 0, lc}; | ||
//+ | ||
Point(2) = {18, 0, 0, lc}; | ||
//+ | ||
Point(3) = {18, 2, 0, lc}; | ||
//+ | ||
Point(4) = {15, 2, 0, lc}; | ||
//+ | ||
Point(5) = {6, 6.5, 0, lc}; | ||
//+ | ||
Point(6) = {0, 6.5, 0, lc}; | ||
//+ | ||
Point(7) = {15, 0, 0, lc}; | ||
//+ | ||
Point(8) = {6, 0, 0, lc}; | ||
|
||
//+ | ||
Line(1) = {1, 8}; | ||
//+ | ||
Line(2) = {8, 7}; | ||
//+ | ||
Line(3) = {7, 2}; | ||
//+ | ||
Line(4) = {2, 3}; | ||
//+ | ||
Line(5) = {3, 4}; | ||
//+ | ||
Line(6) = {4, 5}; | ||
//+ | ||
Line(7) = {5, 6}; | ||
//+ | ||
Line(8) = {6, 1}; | ||
//+ | ||
Line(9) = {5, 8}; | ||
//+ | ||
Line(10) = {4, 7}; | ||
//+ | ||
Curve Loop(1) = {8, 1, -9, 7}; | ||
//+ | ||
Plane Surface(1) = {1}; | ||
//+ | ||
Curve Loop(2) = {9, 2, -10, 6}; | ||
//+ | ||
Plane Surface(2) = {2}; | ||
//+ | ||
Curve Loop(3) = {10, 3, 4, 5}; | ||
//+ | ||
Plane Surface(3) = {3}; | ||
|
||
Extrude {0, 0, 20} { | ||
Surface{1,2,3}; | ||
} | ||
|
||
Transfinite Line "*" = nh; | ||
Transfinite Line {17,18,22,26,44,48,66,70} = 3*nh; | ||
Transfinite Surface "*"; | ||
Recombine Surface "*"; | ||
Transfinite Volume "*"; | ||
//+ | ||
//+ | ||
Physical Surface("cote", 77) = {32, 54, 76, 1, 2, 3}; | ||
//+ | ||
Physical Surface("bas", 78) = {23, 45, 67}; | ||
//+ | ||
Physical Surface("derriere", 79) = {19}; | ||
//+ | ||
Physical Surface("devant", 80) = {71}; | ||
//+ | ||
Physical Volume("bloc", 81) = {2, 1, 3}; |
Oops, something went wrong.