Skip to content

Commit

Permalink
Merge pull request #265 from IvanMary69/dev
Browse files Browse the repository at this point in the history
Connector: Flux conservatifs, Generator: ghost cells Cartesian mesh
  • Loading branch information
vincentcasseau authored Jan 27, 2025
2 parents 190c3dd + ba95d93 commit 2152b00
Show file tree
Hide file tree
Showing 10 changed files with 731 additions and 683 deletions.
330 changes: 322 additions & 8 deletions Cassiopee/Apps/Apps/Fast/IBM.py

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cassiopee/Connector/Connector/IBM.py
Original file line number Diff line number Diff line change
Expand Up @@ -3504,10 +3504,10 @@ def doInterp2(t, tc, tbb, tb=None, typeI='ID', dim=3, dictOfADT=None, front=None

transfo=numpy.zeros(3,dtype=Internal.E_NpyInt)#XOD.getTransfo(dnrZones[nod],zrcv)

connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1]+1,dim__[2]+1,dim__[3]+1)
connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1],dim__[2],dim__[3])


#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1]+1 , dim__[2]+1 , dim__[3]+1)
#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1] , dim__[2] , dim__[3])

NMratio = numpy.zeros(3,dtype=Internal.E_NpyInt)
NMratio[0]=1
Expand Down Expand Up @@ -3611,9 +3611,9 @@ def doInterp2(t, tc, tbb, tb=None, typeI='ID', dim=3, dictOfADT=None, front=None

transfo=numpy.zeros(3,dtype=Internal.E_NpyInt)#XOD.getTransfo(dnrZones[nod],zrcv)

connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1]+1,dim__[2]+1,dim__[3]+1)
connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1],dim__[2],dim__[3])

#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1]+1 , dim__[2]+1 , dim__[3]+1)
#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1] , dim__[2] , dim__[3])

NMratio = numpy.zeros(3,dtype=Internal.E_NpyInt)
NMratio[0]=1
Expand Down Expand Up @@ -3990,10 +3990,10 @@ def doInterp3(t, tc, tbb, tb=None, typeI='ID', dim=3, dictOfADT=None, frontType=

transfo = XOD.getTransfo(dnrZones[nod],zrcv)

connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1]+1,dim__[2]+1,dim__[3]+1)
connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1],dim__[2],dim__[3])


#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1]+1 , dim__[2]+1 , dim__[3]+1)
#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1] , dim__[2] , dim__[3])

NMratio = numpy.zeros(3,dtype=Internal.E_NpyInt)
NMratio[0]=1
Expand Down Expand Up @@ -4097,9 +4097,9 @@ def doInterp3(t, tc, tbb, tb=None, typeI='ID', dim=3, dictOfADT=None, frontType=

transfo=XOD.getTransfo(dnrZones[nod],zrcv)

connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1]+1,dim__[2]+1,dim__[3]+1)
connector.indiceToCoord2(plist,prangedonor,transfo,profondeur,dirD,typ,dirR,plist.size,dim__[1],dim__[2],dim__[3])

#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1]+1 , dim__[2]+1 , dim__[3]+1)
#connector.correctCoeffList(plist, coeff, typ, plist.size , dim__[1], dim__[2], dim__[3])

NMratio = numpy.zeros(3,dtype=Internal.E_NpyInt)
NMratio[0]=1
Expand Down
56 changes: 29 additions & 27 deletions Cassiopee/Connector/Connector/LBM/setInterpTransfers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ PyObject* K_CONNECTOR::___setQintersectionLBM(PyObject* self, PyObject* args){
for (E_Int irac=irac_deb; irac< irac_fin; irac++){
E_Int shift_rac = ech + 4 + timelevel*2 + irac;

if( ipt_param_int[ shift_rac+ nrac*10 + 1] > nbRcvPts_mx)
nbRcvPts_mx = ipt_param_int[ shift_rac+ nrac*10 + 1];
if( ipt_param_int[ shift_rac+ nrac*10 ] > nbRcvPts_mx)
nbRcvPts_mx = ipt_param_int[ shift_rac+ nrac*10 ];
if( ipt_param_int[shift_rac+nrac*3] > ibcTypeMax)
ibcTypeMax = ipt_param_int[shift_rac+nrac*3];

Expand Down Expand Up @@ -226,10 +226,10 @@ PyObject* K_CONNECTOR::___setQintersectionLBM(PyObject* self, PyObject* args){
E_Int irac_auto= irac-irac_deb;
if (autorisation_transferts[pass_inst][irac_auto]==1){
E_Int shift_rac = ech + 4 + timelevel*2 + irac;
E_Int NoD = ipt_param_int[ shift_rac + nrac*5 ];
E_Int loc = ipt_param_int[ shift_rac + nrac*9 +1 ]; //+1 a cause du nrac mpi
E_Int NoR = ipt_param_int[ shift_rac + nrac*11 +1 ];
E_Int nvars_loc = ipt_param_int[ shift_rac + nrac*13 +1 ]; //neq fonction raccord rans/LES
E_Int NoD = ipt_param_int[ shift_rac + nrac*5 ];
E_Int loc = ipt_param_int[ shift_rac + nrac*9 ]; //+1 a cause du nrac mpi
E_Int NoR = ipt_param_int[ shift_rac + nrac*11 ];
E_Int nvars_loc = ipt_param_int[ shift_rac + nrac*13 ]; //neq fonction raccord rans/LES

E_Int meshtype = ipt_ndimdxD[NoD + nidomD*6];
E_Int cnNfldD = ipt_ndimdxD[NoD + nidomD*7];
Expand Down Expand Up @@ -258,13 +258,13 @@ PyObject* K_CONNECTOR::___setQintersectionLBM(PyObject* self, PyObject* args){
// Determine values needed for intersection of Q's
////

E_Int nbRcvPts = ipt_param_int[ shift_rac + nrac*10 + 1 ];
E_Int nbRcvPts = ipt_param_int[ shift_rac + nrac*10 ];
E_Int pos;
pos = ipt_param_int[ shift_rac + nrac*7 ] ; E_Int* ntype = ipt_param_int + pos;
pos = pos +1 + ntype[0] ; E_Int* types = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*6 ]; E_Int* donorPts = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*12 + 1 ]; E_Int* rcvPts = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*8 ]; E_Float* ptrCoefs = ipt_param_real + pos;
pos = ipt_param_int[ shift_rac + nrac*7 ] ; E_Int* ntype = ipt_param_int + pos;
pos = pos +1 + ntype[0] ; E_Int* types = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*6 ]; E_Int* donorPts = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*12 ]; E_Int* rcvPts = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*8 ]; E_Float* ptrCoefs = ipt_param_real + pos;

E_Int nbInterpD = ipt_param_int[ shift_rac + nrac ];
E_Float* xPC =NULL;
Expand Down Expand Up @@ -560,6 +560,8 @@ PyObject* K_CONNECTOR::___setInterpTransfersLBM(PyObject* self, PyObject* args){
size_autorisation = K_FUNC::E_max(size_autorisation , nrac_inst+1);

E_Int autorisation_transferts[pass_inst_fin][size_autorisation];
E_Int ntab_int =18;

//on dimension tableau travail pour IBC
E_Int nbRcvPts_mx =0; E_Int ibcTypeMax=0;
for (E_Int pass_inst=pass_inst_deb; pass_inst< pass_inst_fin; pass_inst++){
Expand All @@ -570,15 +572,15 @@ PyObject* K_CONNECTOR::___setInterpTransfersLBM(PyObject* self, PyObject* args){
for (E_Int irac=irac_deb; irac< irac_fin; irac++){

E_Int shift_rac = ech + 4 + timelevel*2 + irac;
if( ipt_param_int[ shift_rac+ nrac*10 + 1] > nbRcvPts_mx) nbRcvPts_mx = ipt_param_int[ shift_rac+ nrac*10 + 1];
if( ipt_param_int[ shift_rac+ nrac*10] > nbRcvPts_mx) nbRcvPts_mx = ipt_param_int[ shift_rac+ nrac*10];
if( ipt_param_int[shift_rac+nrac*3] > ibcTypeMax) ibcTypeMax = ipt_param_int[shift_rac+nrac*3];
E_Int irac_auto= irac-irac_deb;
autorisation_transferts[pass_inst][irac_auto]=0;

// Si on est en explicit local, on va autoriser les transferts entre certaines zones seulement en fonction de la ss-ite courante
//printf("rk,exploc=%d %d\n",rk,exploc);
if(rk==3 && exploc == 2){
E_Int debut_rac = ech + 4 + timelevel*2 + 1 + nrac*16 + 27*irac;
E_Int debut_rac = ech + 4 + timelevel*2 + nrac*ntab_int + 27*irac;
E_Int levelD = ipt_param_int[debut_rac + 25];
E_Int levelR = ipt_param_int[debut_rac + 24];
E_Int cyclD = nitmax/levelD;
Expand Down Expand Up @@ -611,7 +613,7 @@ PyObject* K_CONNECTOR::___setInterpTransfersLBM(PyObject* self, PyObject* args){
else {continue;}
}
else if(exploc == 19){
E_Int debut_rac = ech + 4 + timelevel*2 + 1 + nrac*16 + 27*irac;
E_Int debut_rac = ech + 4 + timelevel*2 + nrac*ntab_int + 27*irac;
E_Int levelD = ipt_param_int[debut_rac + 25];
E_Int levelR = ipt_param_int[debut_rac + 24];
E_Int cyclD = nitmax/levelD;
Expand Down Expand Up @@ -715,7 +717,7 @@ PyObject* K_CONNECTOR::___setInterpTransfersLBM(PyObject* self, PyObject* args){

for (E_Int irac=irac_deb; irac< irac_fin; irac++){
E_Int irac_auto= irac-irac_deb;
E_Int debut_rac = ech + 4 + timelevel*2 + 1 + nrac*16 + 27*irac;
E_Int debut_rac = ech + 4 + timelevel*2 + nrac*ntab_int + 27*irac;
E_Int levelD = ipt_param_int[debut_rac + 25];
E_Int levelR = ipt_param_int[debut_rac + 24];

Expand All @@ -735,11 +737,11 @@ PyObject* K_CONNECTOR::___setInterpTransfersLBM(PyObject* self, PyObject* args){
E_Int ibc = 1;
if (ibcType < 0) ibc = 0;
if(1-ibc != ipass_typ) continue;
E_Int NoD = ipt_param_int[ shift_rac + nrac*5 ];
E_Int loc = ipt_param_int[ shift_rac + nrac*9 +1 ]; //+1 a cause du nrac mpi
E_Int NoR = ipt_param_int[ shift_rac + nrac*11 +1 ];
E_Int nvars_loc= ipt_param_int[ shift_rac + nrac*13 +1 ]; //neq fonction raccord rans/LES
E_Int rotation = ipt_param_int[ shift_rac + nrac*14 +1 ]; //flag pour periodicite azimutale
E_Int NoD = ipt_param_int[ shift_rac + nrac*5 ];
E_Int loc = ipt_param_int[ shift_rac + nrac*9 ];
E_Int NoR = ipt_param_int[ shift_rac + nrac*11 ];
E_Int nvars_loc= ipt_param_int[ shift_rac + nrac*13 ]; //neq fonction raccord rans/LES
E_Int rotation = ipt_param_int[ shift_rac + nrac*14 ]; //flag pour periodicite azimutale



Expand Down Expand Up @@ -835,14 +837,14 @@ PyObject* K_CONNECTOR::___setInterpTransfersLBM(PyObject* self, PyObject* args){
// Interpolation parallele
////

E_Int nbRcvPts = ipt_param_int[ shift_rac + nrac*10 + 1 ];
E_Int nbRcvPts = ipt_param_int[ shift_rac + nrac*10 ];

E_Int pos;
pos = ipt_param_int[ shift_rac + nrac*7 ] ; E_Int* ntype = ipt_param_int + pos;
pos = pos +1 + ntype[0] ; E_Int* types = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*6 ]; E_Int* donorPts = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*12 + 1 ]; E_Int* rcvPts = ipt_param_int + pos; // donor et receveur inverser car storage donor
pos = ipt_param_int[ shift_rac + nrac*8 ]; E_Float* ptrCoefs = ipt_param_real + pos;
pos = ipt_param_int[ shift_rac + nrac*7 ]; E_Int* ntype = ipt_param_int + pos;
pos = pos +1 + ntype[0] ; E_Int* types = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*6 ]; E_Int* donorPts = ipt_param_int + pos;
pos = ipt_param_int[ shift_rac + nrac*12]; E_Int* rcvPts = ipt_param_int + pos; // donor et receveur inverser car storage donor
pos = ipt_param_int[ shift_rac + nrac*8 ]; E_Float* ptrCoefs = ipt_param_real + pos;


E_Int nbInterpD = ipt_param_int[ shift_rac + nrac ];
Expand Down
Loading

0 comments on commit 2152b00

Please sign in to comment.