Skip to content

Commit

Permalink
All: minor modifs, Transform: subzone arg changed to None
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit128 committed Jun 28, 2024
1 parent 007509a commit cf9a4b0
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cassiopee/CPlot/test/displayOSMesa_m1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

a = D.sphere((0,Cmpi.rank,0), 1, N=200)

# posCam, posEye, dirCam are compulosary for parallel export (otherwise autofit)
# posCam, posEye, dirCam are compulsary for parallel export (otherwise autofit)
CPlot.display(a, mode=1, offscreen=7, export=LOCAL+'/out.png',
posCam=(-3,0,0), posEye=(0,0,0), dirCam=(0,0,1))
CPlot.finalizeExport(7)
Expand Down
7 changes: 7 additions & 0 deletions Cassiopee/Converter/Converter/kpython
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ else
set +x
[ $? != 0 ] && exit 1;
elif [ "$ELSAPROD" = 'ld' ] || [ "$ELSAPROD" = 'ld_i8' ] # ld
then
set -x
# openMpi
mpirun $ARGS -x OMP_NUM_THREADS=$NTHREADS -np $NPROCS $PYTHONEXE $SCRIPT
set +x
[ $? != 0 ] && exit 1;
elif [ "$ELSAPROD" = 'visung_r8' ] || [ "$ELSAPROD" = 'visung_r8_i8' ] # visung
then
set -x
# openMpi
Expand Down
1 change: 0 additions & 1 deletion Cassiopee/KCore/Dist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Functions used in *Cassiopee* modules setup.py
import os, sys, distutils.sysconfig, platform, glob, subprocess

Expand Down
22 changes: 22 additions & 0 deletions Cassiopee/KCore/doc/source/Geom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ List of functions
.. autosummary::

Geom.point
Geom.cloud
Geom.line
Geom.polyline
Geom.circle
Expand Down Expand Up @@ -131,6 +132,27 @@ A polyline is defined as a C0 i-array which contains only the polyline points (w
* `Creation of a point (pyTree) <Examples/Geom/pointPT.py>`_:

.. literalinclude:: ../build/Examples/Geom/pointPT.py

---------------------------------------

.. py:function:: Geom.cloud(arr)
Create a point cloud of coordinates arr=(X,Y,Z) where X=[x1, x2, ..., xn]

:param arr: (x,y,z) of point cloud
:type arr: 3-tuple of lists/numpy.ndarrays
:return: a point cloud
:rtype: one array/zone (NODE)

*Example of use:*

* `Creation of a point cloud (array) <Examples/Geom/cloud.py>`_:

.. literalinclude:: ../build/Examples/Geom/cloud.py

* `Creation of a point cloud (pyTree) <Examples/Geom/cloudPT.py>`_:

.. literalinclude:: ../build/Examples/Geom/cloudPT.py

---------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/KCore/doc/source/Initiator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ List of functions

.. autosummary::

MeshSize.meshSize
MeshSize.meshSize

Contents
#########
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/OCC/OCC/Atomic/meshEdge2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ E_Int __getParamHmaxHausd(const TopoDS_Edge& E, E_Float hmax, E_Float hausd, E_I
index.push_back(i);
}
}
for (size_t i = 0; i < index.size(); i++) printf("split %ld\n", i);
for (size_t i = 0; i < index.size(); i++) printf("split %zu\n", i);

E_Int size = index.size();
if (size == 0 && state == 0)
Expand Down
4 changes: 2 additions & 2 deletions Cassiopee/Transform/Transform/PyTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@ def subzoneGC__(z, dim, imin, imax, jmin, jmax, kmin, kmax, \
zoneDonor=[ddDnrs[nor]], rangeDonor='doubly_defined')
return z

def subzone(t, minIndex, maxIndex=(), type=None):
def subzone(t, minIndex, maxIndex=None, type=None):
"""Take a subzone of mesh.
Usage: subzone(t, (imin,jmin,kmin), (imax,jmax,kmax))"""
if maxIndex == (): return subzoneUnstruct__(t, minIndex, type)
if maxIndex is None: return subzoneUnstruct__(t, minIndex, type)
else: return subzoneStruct__(t, minIndex, maxIndex)

def subzoneUnstruct__(t, indices, type):
Expand Down
6 changes: 3 additions & 3 deletions Cassiopee/Transform/test/rotatePT_t2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
a = C.center2Node(a, 'centers:VelocityX')
# Rotate with axis+angle
b = T.rotate(a, (0.,0.,0.), (0.,0.,1.), 90., vectors=vectnames)
test.testT(b,1)
test.testT(b, 1)
# Rotate with axis transformations
c = T.rotate(a, (0.,0.,0.), ((1.,0.,0.),(0,1,0),(0,0,1)),
((1,1,0), (1,-1,0), (0,0,1)), vectors=vectnames)
test.testT(c,2)
test.testT(c, 2)

# Rotate with three angles
d = T.rotate(a, (0.,0.,0.), (0.,0.,90.), vectors=vectnames)
test.testT(d,3)
test.testT(d, 3)
17 changes: 8 additions & 9 deletions Cassiopee/XCore/XCore/intersectMesh/smesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <queue>
#include <stack>


bool Smesh::ccw_oriented(E_Int face)
{
E_Float sum = 0;
Expand Down Expand Up @@ -576,25 +575,25 @@ void Smesh::write_su2(const char *fname, const std::vector<E_Int> &faces)
FILE *fh = fopen(fname, "w");
assert(fh);
fprintf(fh, "NDIME= 2\n");
fprintf(fh, "NELEM= %lu\n", faces.size());
fprintf(fh, "NELEM= %zu\n", faces.size());

for (size_t i = 0; i < faces.size(); i++) {
E_Int f = faces[i];
const auto &cn = F[f];
if (cn.size() == 4) fprintf(fh, "%d ", QUAD);
else fprintf(fh, "%d ", TRI);
for (auto p : cn) fprintf(fh, "%d ", pmap[p]);
fprintf(fh, "%lu\n", i);
fprintf(fh, "%zu\n", i);
}

std::vector<E_Int> ipmap(pmap.size());
for (auto &pdata : pmap) ipmap[pdata.second] = pdata.first;

fprintf(fh, "NPOIN= %lu\n", ipmap.size());
fprintf(fh, "NPOIN= %zu\n", ipmap.size());
for (size_t i = 0; i < ipmap.size(); i++) {
E_Int op = ipmap[i];
fprintf(fh, "%f %f ", X[op], Y[op]);
fprintf(fh, "%lu\n", i);
fprintf(fh, "%zu\n", i);
}

fclose(fh);
Expand Down Expand Up @@ -748,12 +747,12 @@ void Smesh::write_ngon(const char *fname)
fprintf(fh, "0 ");
for (E_Int i = 0; i < ne; i++) {
sizeNGon += 2;
fprintf(fh, "%lu ", sizeNGon);
fprintf(fh, "%zu ", sizeNGon);
}
fprintf(fh, "\n");

fprintf(fh, "NGON\n");
fprintf(fh, "%lu\n", sizeNGon);
fprintf(fh, "%zu\n", sizeNGon);
for (E_Int i = 0; i < ne; i++) {
fprintf(fh, "%d %d ", E[i].p, E[i].q);
}
Expand All @@ -765,12 +764,12 @@ void Smesh::write_ngon(const char *fname)
fprintf(fh, "0 ");
for (E_Int i = 0; i < nf; i++) {
sizeNFace += F2E[i].size();
fprintf(fh, "%lu ", sizeNFace);
fprintf(fh, "%zu ", sizeNFace);
}
fprintf(fh, "\n");

fprintf(fh, "NFACE\n");
fprintf(fh, "%lu\n", sizeNFace);
fprintf(fh, "%zu\n", sizeNFace);
for (E_Int i = 0; i < nf; i++) {
for (E_Int e : F2E[i]) fprintf(fh, "%d ", e);
//fprintf(fh, "\n");
Expand Down
File renamed without changes.

0 comments on commit cf9a4b0

Please sign in to comment.