/*==================================================================================== ! Purpose(s): ! ! Contain(s): ! ! Author(s): Javier Lopez Lara (jav.lopez@unican.es) ! Gabriel Barajas (barajasg@unican.es) !====================================================================================*/ #include "CArrayMasks.h" #include #include "CMisc.h" #include #include "CVars.h" #ifdef __INTEL_COMPILER #define PYM cfillporosityarray #else #define PYM cfillporosityarray_ #endif extern "C" void _FORTRAN PYM (_INT_ARRAY Anpc, _INT_ARRAY AXnpc, _INT Aim1, _INT Ajm1) { /*!======================================================================= ! Purpose(s): Given porosity index array (Anpc), fills another array with extended porosity info. ! This extended information is just the porosity index at sides L, R, T, B. ! ! Author(s): Javier Lopez Lara (jav.lopez@unican.es) ! Gabriel Barajas (barajasg@unican.es) !=======================================================================*/ int L, T, R, B; int IMax=Aim1+1; int JMax=Ajm1+1; // Creates the mesh object. TMesh Mesh(IMax, JMax); // Creates the masks. TIntMask wPorIdx (Mesh, Anpc); TIntMask wXPorIdx(Mesh, AXnpc); Mesh.DefineArea(1, Aim1, 1, Ajm1); Mesh.First(); do { int PorousCells=wPorIdx.NodesNotEqualTo(1); L=0; R=0; T=0; B=0; if ((PorousCells & CLTRB_B)!=0) // If the cell or one of the sourrounding ones has porous material... { if ((PorousCells & CR_B)!=0) { if (wPorIdx.c()!=1) R=wPorIdx.c()-1; else R=wPorIdx.r()-1; } if ((PorousCells & LC_B)!=0) { if (wPorIdx.l()!=1) L=wPorIdx.l()-1; else L=wPorIdx.c()-1; } if ((PorousCells & CT_B)!=0) { if (wPorIdx.c()!=1) T=wPorIdx.c()-1; else T=wPorIdx.t()-1; } if ((PorousCells & BC_B)!=0) { if (wPorIdx.b()!=1) B=wPorIdx.b()-1; else B=wPorIdx.c()-1; } } //if *wXPorIdx.C=IdxPack(L, R, T, B); } while(Mesh.Next()); }