Skip to content

Commit

Permalink
Merge branch 'main' of github.com:onera/Cassiopee
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Jul 11, 2024
2 parents 91072a1 + 6269321 commit eee29b3
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 59 deletions.
2 changes: 0 additions & 2 deletions Cassiopee/Apps/test/IBMrotation_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@
R._copyGrid2GridInit(tc)
C.convertPyTree2File(tc, LOCAL+'/tc.cgns')

os.remove(LOCAL+'/octree.cgns')

Internal._rmNodesByName(t, '.Solver#Param')
Internal._rmNodesByName(t, '.Solver#ownData')
Internal._rmNodesByName(tc, '.Solver#Param')
Expand Down
1 change: 0 additions & 1 deletion Cassiopee/Converter/test/getPathsFromValuePT_t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

a = G.cart((0,0,0), (1,1,1), (10,10,10))
t = C.newPyTree(['Base', a])
C.convertPyTree2File(t, 'out.cgns')

# Return nodes with given value
paths = Internal.getPathsFromValue(t, 'Structured')
Expand Down
7 changes: 5 additions & 2 deletions Cassiopee/Envs/env_Cassiopee_local
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,12 @@ else if ($MAC == "macosx") then

else if ($MAC == "ubuntu") then
#-------------------------------- ubuntu ------------------------------------
setenv ELSAPROD ub_r8
setenv ELSAPROD ubuntu
setenv ELSAPROD "$ELSAPROD$INTTYPE"
setenv OMP_NUM_THREADS 2
setenv OMP_NUM_THREADS 4
setenv PYTHONEXE=python3
setenv PRODMODE=1
setenv PIP_DISABLE_PIP_VERSION_CHECK=1

else if ($MAC == "fulvio") then
#------------------------------- fulvio ---------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions Cassiopee/Envs/sh_Cassiopee_local
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ elif [ "$MAC" = "macosx" ]; then

elif [ "$MAC" = "ubuntu" ]; then
#-------------------------------- ubuntu --------------------------------------
export ELSAPROD=ub_r8
export ELSAPROD=ubuntu
export ELSAPROD=$ELSAPROD$INTTYPE
export OMP_NUM_THREADS=2
export OMP_NUM_THREADS=4
export PYTHONEXE=python3
export PRODMODE=1
export PIP_DISABLE_PIP_VERSION_CHECK=1

elif [ "$MAC" = "visio" ]; then
#----------------------------- visio -----------------------------------------
Expand Down Expand Up @@ -191,7 +194,6 @@ elif [ "$MAC" = "visung_el8" ]; then
export PYTHONEXE=python3
export OMP_NUM_THREADS=72
#export PRODMODE=1
#export PIP_DISABLE_PIP_VERSION_CHECK=1
unset I_MPI_PMI_LIBRARY

elif [ "$MAC" = "austri" ]; then
Expand Down
15 changes: 7 additions & 8 deletions Cassiopee/Generator/Generator/IBM.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
import Transform.PyTree as T
import Converter.Internal as Internal
import Connector.IBM as X_IBM
import Geom.IBM as D_IBM
import Geom.PyTree as D
import Post.PyTree as P
import Converter
import Transform
import Converter.GhostCells as CGC
import Connector.PyTree as X
import Converter.Mpi as Cmpi
import Converter.Filter as Filter
import numpy

EPSCART = 1.e-6

def generateCartMesh__(o, parento=None, dimPb=3, vmin=11, DEPTH=2, sizeMax=4000000, check=True,
def generateCartMesh__(o, parento=None, dimPb=3, vmin=11, DEPTH=2, sizeMax=4000000, check=False,
externalBCType='BCFarfield', bbox=None):

# Estimation du nb de pts engendres
Expand Down Expand Up @@ -47,7 +46,7 @@ def generateCartMesh__(o, parento=None, dimPb=3, vmin=11, DEPTH=2, sizeMax=40000

if bbox is None: bbox = G.bbox(o)
del o
X_IBM._addExternalBCs(t, bbox, DEPTH, externalBCType, dimPb)
_addExternalBCs(t, bbox, DEPTH, externalBCType, dimPb)

nptsTot = 0
for zp in Internal.getZones(t):
Expand All @@ -60,7 +59,7 @@ def generateCartMesh__(o, parento=None, dimPb=3, vmin=11, DEPTH=2, sizeMax=40000

def adaptIBMMesh(t, tb, vmin, sensor, factor=1.2, DEPTH=2, sizeMax=4000000,
variables=None, refineFinestLevel=False, refineNearBodies=False,
check=True, externalBCType='BCFarfield', fileo='octree.cgns',
check=False, externalBCType='BCFarfield', fileo='octree.cgns',
isAMR=False,valMin=0,valMax=1):
if fileo is None: raise ValueError("adaptIBMMesh: Octree mesh must be specified by a file.")
try: to = C.convertFile2PyTree(fileo)
Expand Down Expand Up @@ -117,7 +116,7 @@ def adaptIBMMesh(t, tb, vmin, sensor, factor=1.2, DEPTH=2, sizeMax=4000000,


def generateIBMMesh(tb, vmin=15, snears=None, dfar=10., dfarList=[], DEPTH=2, tbox=None,
snearsf=None, check=True, sizeMax=4000000,
snearsf=None, check=False, sizeMax=4000000,
externalBCType='BCFarfield', to=None,
fileo=None, expand=2, dfarDir=0, mode=0):
dimPb = Internal.getNodeFromName(tb, 'EquationDimension')
Expand Down Expand Up @@ -362,7 +361,7 @@ def _addBCsForSymmetry(t, bbox=None, dimPb=3, dir_sym=0, X_SYM=0., depth=2):


def generateIBMMeshPara(tb, vmin=15, snears=None, dimPb=3, dfar=10., dfarList=[], tbox=None,
snearsf=None, check=True, to=None, ext=2,
snearsf=None, check=False, to=None, ext=2,
expand=3, dfarDir=0, check_snear=False, mode=0,
tbOneOver=None, listF1save=[], fileoutpre=['./','template.cgns']):
import KCore.test as test
Expand Down Expand Up @@ -1000,7 +999,7 @@ def octree2StructLoc__(o, parento=None, vmin=21, ext=0, optimized=0, sizeMax=4e6
return zones
else:
bbox0 = G.bbox(o)
X_IBM._addBCOverlaps(zones, bbox0)
_addBCOverlaps(zones, bbox0)
return zones

# only in octree2StructLoc__
Expand Down
1 change: 1 addition & 0 deletions Cassiopee/Post/Post/IBM.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ def createCloudIBM__(tc, ibctypes=[]):
XW = Internal.getNodeFromName(IBCD,'CoordinateX_PW')[1]
YW = Internal.getNodeFromName(IBCD,'CoordinateY_PW')[1]
ZW = Internal.getNodeFromName(IBCD,'CoordinateZ_PW')[1]
if len(XW) < 2: continue
zsize = numpy.empty((1,3), Internal.E_NpyInt, order='F')
zsize[0,0] = XW.shape[0]; zsize[0,1] = 0; zsize[0,2] = 0
newName = 'IBW_%sX%d'%(cpt_name, Cmpi.rank)
Expand Down
62 changes: 62 additions & 0 deletions docs/developers/Git/UsingGit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Using git

## Forks
To help developping Cassiopee, you have to first fork the
Cassiopee repository.

Regularly, you will have to "sync" your fork using the "sync" button
on the web site of your fork.
When syncing, your fork is updated from the main repository.

## Pulling
Pulling is updating your sources from your fork (after syncing):
```sh
git pull
```
If you have modified the same sources as the one that has been touched on the main repository, this operation will fail. You then have to move your modification aside by doing:
```sh
git stash
git pull
```
The pull will be ok, since no local modification exists. You now have to put back your modifications with:
```sh
git stash apply
```
You local modifications will be merged. Merge problem may occur and you will have to edit some files to choose the right code.

## Commiting
Commiting will commit your modifications locally. Nothing is sent.
To check the files you have modified:
```sh
git status
```
To see the differences:
```sh
git diff <file>
```

Before commiting, you must first tag files for commit using:
```sh
git add <file>
```
or tag all modified files:
```sh
git add -u
```

You can then commit:
```sh
git commit -m "message"
```

## Pushing to your fork
Pushing is submitting your modifications to your fork.
```sh
git push
```

## Merging to main repository

Finally, to send your modifications to the main repository, you have to
submit a merge request. Go to your fork web site and click on "submit merge request". Add some comments about what you have down and click ok.

65 changes: 36 additions & 29 deletions docs/developers/Install/msys2.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
# Installation sous msys2 (windows)
# Installation on msys2 (windows)

## Install msys2
Download msys2 (https://www.msys2.org)
Install it
and install it.

## Install dependencies
In an msys2 mingw64 terminal:

pacman -S mingw64/mingw-w64-x86_64-gcc
pacman -S mingw64/mingw-w64-x86_64-gcc-fortran
pacman -S mingw64/mingw-w64-x86_64-python
pacman -S mingw64/mingw-w64-x86_64-python-numpy
pacman -S mingw64/mingw-w64-x86_64-scons
pacman -S mingw64/mingw-w64-x86_64-python-pip
pacman -S mingw64/mingw-w64-x86_64-python-pip-tools
pacman -S mingw64/mingw-w64-x86_64-hdf5
pacman -S mingw64/mingw-w64-x86_64-msmpi
pacman -S mingw64/mingw-w64-x86_64-oce
```shell
pacman -S mingw64/mingw-w64-x86_64-gcc
pacman -S mingw64/mingw-w64-x86_64-gcc-fortran
pacman -S mingw64/mingw-w64-x86_64-python
pacman -S mingw64/mingw-w64-x86_64-python-numpy
pacman -S mingw64/mingw-w64-x86_64-scons
pacman -S mingw64/mingw-w64-x86_64-python-pip
pacman -S mingw64/mingw-w64-x86_64-python-pip-tools
pacman -S mingw64/mingw-w64-x86_64-hdf5
pacman -S mingw64/mingw-w64-x86_64-msmpi
pacman -S mingw64/mingw-w64-x86_64-oce
```

## Install Cassiopee

export CASSIOPEE=/d/johndo/Cassiopee
export MACHINE=win64
```shell
export CASSIOPEE=/d/johndo/Cassiopee
export MACHINE=win64

source $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8
cd $CASSIOPEE/Cassiopee
./install
source $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8
cd $CASSIOPEE/Cassiopee
./install
```

## Some usefull pacman commands

Update system:

pacman -Syu
```shell
pacman -Syu
```

Find package matching keyword:

pacman -Ss <keyword>
```shell
pacman -Ss <keyword>
```

Install package:

pacman -S <package>
```shell
pacman -S <package>
```

List installed packages:
```shell
pacman -Qe
```

pacman -Qe

Remove package:

pacman -Rs <package>
```shell
pacman -Rs <package>
```
43 changes: 29 additions & 14 deletions docs/developers/Install/ubuntu.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
# Installation sous ubuntu (linux)
# Installation on ubuntu (linux)

## Install dependencies

sudo apt-get install python-dev
sudo apt-get install python-numpy
sudo apt-get install scons
sudo apt-get install gcc
sudo apt-get install gfortran
sudo apt-get install xorg-dev
```shell
sudo apt-get install python3-dev
sudo apt-get install python-numpy
sudo apt-get install scons
sudo apt-get install gcc
sudo apt-get install gfortran
sudo apt-get install hdf5
sudo apt-get install xorg-dev
```

## Install Cassiopee

export CASSIOPEE=/d/johndo/Cassiopee
export MACHINE=ubuntu
```shell
export CASSIOPEE=/d/johndo/Cassiopee
export MACHINE=ubuntu

source $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8
cd $CASSIOPEE/Cassiopee
./install
source $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8
cd $CASSIOPEE/Cassiopee
./install
```

## Using apt_get

Find package from keyword:
```shell
apt-cache search <keyword>
```

Install package:
```shell
sudo apt-get install <package>
```

0 comments on commit eee29b3

Please sign in to comment.