Skip to content

Commit

Permalink
Merge branch 'onera:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
imadhammani authored Sep 10, 2024
2 parents ae5a3bf + fd5569f commit 179fe19
Show file tree
Hide file tree
Showing 77 changed files with 781 additions and 397 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
tags:
- 'v*'
branches:
- 'main'
# branches:
# - 'main'

jobs:
docker:
Expand Down
8 changes: 5 additions & 3 deletions Cassiopee/CPlot/CPlot/Display/displaySMeshZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ void Data::displaySMeshZone(StructZone* zonep, E_Int zone)
if (ptrState->dim == 2) nk = 1;
E_Int nij = ni*nj;

if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1)
{ glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }
bool is1D = false;
if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1) is1D = true;

if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }

#include "selection.h"

Expand All @@ -112,7 +114,7 @@ void Data::displaySMeshZone(StructZone* zonep, E_Int zone)
#include "displaySMeshZone.h"

// Zones 1D: on ajoute les noeuds
if (nj*nk == 1 || ni*nk == 1 || ni*nj == 1)
if (is1D)
{
glBegin(GL_QUADS);
if (zonep->blank == 0)
Expand Down
6 changes: 4 additions & 2 deletions Cassiopee/CPlot/CPlot/Display/displayUMeshHOZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ void Data::displayUMeshZone_ho(UnstructZone* zonep, E_Int zone, E_Int zonet)
#include "selection.h"

E_Int eltType0 = zonep->eltType[0];
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) glLineWidth(3.);
bool is1D = false;
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true;
if (is1D) glLineWidth(3.);
int ishader = 3;
this->_shaders.set_tesselation(ishader);
this->_shaders.activate((short unsigned int)this->_shaders.shader_id(shader::None));
Expand All @@ -113,7 +115,7 @@ void Data::displayUMeshZone_ho(UnstructZone* zonep, E_Int zone, E_Int zonet)
this->_shaders.set_tesselation(0);

// For BARS or NODES or 1D NGONS: display nodes
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0))
if (is1D)
{
glBegin(GL_QUADS);
if (zonep->blank == 0)
Expand Down
10 changes: 6 additions & 4 deletions Cassiopee/CPlot/CPlot/Display/displayUMeshZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ void Data::displayUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet)
E_Float nz = 1./_numberOfUnstructZones;
#include "meshStyles.h"

E_Int eltType0 = zonep->eltType[0];
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0))
{ glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }
E_Int eltType0 = zonep->eltType[0];
bool is1D = false;
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true;

if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }

#include "selection.h"

Expand All @@ -120,7 +122,7 @@ void Data::displayUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet)
#include "displayUMeshZone.h"

// For BARS or NODES or 1D NGONS: display node
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0))
if (is1D)
{
glBegin(GL_QUADS);
if (zonep->blank == 0)
Expand Down
13 changes: 4 additions & 9 deletions Cassiopee/CPlot/CPlot/Display/meshStyles.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,13 @@
break;

case 4:
// Wires multicolor grb
getrgb(this, zone*1./_numberOfZones, &g, &r, &b);
//color1[0] = r; color1[1] = b; color1[2] = g;
complementColor(g,r,b, color1[0],color1[1],color1[2]);
if (color1[2] > 0.8 && color1[0] < 0.2 && color1[1] < 0.2)
{ r = color1[0]; g = color1[1]; b = color1[2];
color1[0] = b; color1[1] = r; color1[2] = g;}
color2[0] = 0.7; color2[1] = 0.88; color2[2] = 1.;
// Wires noirs fins
color1[0] = 0.; color1[1] = 0.; color1[2] = 0.;
color2[0] = 0.7; color2[1] = 0.88; color2[2] = 1.;
// Ecrasement si render tag
if (zonep->colorR != -1.)
{ complementColor(zonep->colorR,zonep->colorG,zonep->colorB, color1[0],color1[1],color1[2]); }
glLineWidth(1.5*resf);
glLineWidth(0.4*resf);
break;

default:
Expand Down
11 changes: 8 additions & 3 deletions Cassiopee/CPlot/CPlot/Display/renderDLSIsoSolidZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ void DataDL::renderSIsoSolidZone(StructZone* zonep, E_Int zone, E_Int nofield)
// Blending
blend = 1.;
#include "selection2.h"
bool is1D = false;
if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1) is1D = true;


#ifdef __SHADERS__
int curr = _shaders.currentShader();
if (curr != 0) _shaders[curr]->setUniform("blend", (float)blend);
glColor4f(0.,0.,0., blend); // pour imposer blend

if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1)
if (is1D)
{
if (curr != 0) _shaders[curr]->setUniform("lightOn", (int)0); // impose isoLight off on 1D meshes
}
Expand All @@ -58,7 +61,7 @@ void DataDL::renderSIsoSolidZone(StructZone* zonep, E_Int zone, E_Int nofield)
glCallList(zoneImpl->_DLiso);

#ifdef __SHADERS__
if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1)
if (is1D)
{
if (ptrState->isoLight == 1 && ptrState->dim == 3)
{
Expand Down Expand Up @@ -96,6 +99,8 @@ void DataDL::renderSIsoSolidZone(StructZone* zonep, E_Int zone, E_Int nofield1,
// Blending
blend = 1.;
#include "selection2.h"
bool is1D = false;
if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1) is1D = true;

#ifdef __SHADERS__
int curr = _shaders.currentShader();
Expand All @@ -108,7 +113,7 @@ void DataDL::renderSIsoSolidZone(StructZone* zonep, E_Int zone, E_Int nofield1,
glCallList(zoneImpl->_DLiso);

// Pour les lignes
if (nij == 1 || ni*nk == 1 || nj*nk == 1)
if (is1D)
{
glBegin(GL_LINES);
E_Int nie, nje, nke;
Expand Down
8 changes: 4 additions & 4 deletions Cassiopee/CPlot/CPlot/Display/renderDLSMeshZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ void DataDL::renderGPUSMeshZone(StructZone* zonep, E_Int zone)
E_Int nj = zonep->nj;
E_Int nk = zonep->nk;
if (ptrState->dim == 2) nk = 1;

if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1)
{ glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }
bool is1D = false;
if (ni*nj == 1 || ni*nk == 1 || nj*nk == 1) is1D = true;
if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }
#include "selection.h"

d = dist2BB(_view.xcam, _view.ycam, _view.zcam,
Expand All @@ -120,7 +120,7 @@ void DataDL::renderGPUSMeshZone(StructZone* zonep, E_Int zone)
glLineWidth(1.);

// Zones 1D: on ajoute les noeuds
if (nj*nk == 1 || ni*nk == 1 || ni*nj == 1)
if (is1D)
{
glBegin(GL_QUADS);
if (zonep->blank == 0)
Expand Down
6 changes: 4 additions & 2 deletions Cassiopee/CPlot/CPlot/Display/renderDLUIsoSolidZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ void DataDL::renderUIsoSolidZone(UnstructZone* zonep, E_Int zonet, E_Int nofield
#include "selection2.h"

E_Int eltType0 = zonep->eltType[0];
bool is1D = false;
if ((eltType0 == 1) || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true;

#ifdef __SHADERS__
int curr = _shaders.currentShader();
if (curr != 0) _shaders[curr]->setUniform("blend", (float)blend);
glColor4f(0.,0.,0., blend); // pour imposer blend

if ((eltType0 == 1) || (eltType0 == 10 && zonep->nelts1D > 0))
if (is1D)
{
if (curr != 0) _shaders[curr]->setUniform("lightOn", (int)0); // impose isoLight off on 1D meshes
}
Expand All @@ -53,7 +55,7 @@ void DataDL::renderUIsoSolidZone(UnstructZone* zonep, E_Int zonet, E_Int nofield
glCallList(zoneImpl->_DLiso);

#ifdef __SHADERS__
if ((eltType0 == 1) || (eltType0 == 10 && zonep->nelts1D > 0))
if (is1D)
{
if (ptrState->isoLight == 1 && ptrState->dim == 3)
{
Expand Down
8 changes: 4 additions & 4 deletions Cassiopee/CPlot/CPlot/Display/renderDLUMeshZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ void DataDL::renderGPUUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet)
double* y = zonep->y;
double* z = zonep->z;
E_Int eltType0 = zonep->eltType[0];

if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0))
{ glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }
bool is1D = false;
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0)) is1D = true;
if (is1D) { glLineWidth(3.); color2[0] = 0.1; color2[1] = 0.1; color2[2] = 1.; }
#include "selection.h"

// glCallList(zonep->_DLmesh);
Expand All @@ -129,7 +129,7 @@ void DataDL::renderGPUUMeshZone(UnstructZone* zonep, E_Int zone, E_Int zonet)
glCallList(zImpl->_DLmesh);

// For BARS, NODE, 1D NGONS: display node
if (eltType0 == 1 || eltType0 == 0 || (eltType0 == 10 && zonep->nelts1D > 0))
if (is1D)
{
glBegin(GL_QUADS);
if (zonep->blank == 0)
Expand Down
3 changes: 1 addition & 2 deletions Cassiopee/CPlot/CPlot/Display/renderDLUSolidHOZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ void DataDL::renderGPUUSolidHOZone(UnstructZone *zonep, E_Int zone, E_Int zonet)

E_Int eltType0 = zonep->eltType[0];
bool is1D = ( (eltType0 == 1) | (eltType0 == 10 && zonep->nelts1D > 0) );
if (is1D == true && ptrState->mode == RENDER)
glLineWidth( 1. + 5 * zonep->shaderParam1);
if (is1D == true && ptrState->mode == RENDER) glLineWidth( 1. + 5 * zonep->shaderParam1);
else if (is1D == true) glLineWidth(3.);
else glLineWidth(1.);

Expand Down
26 changes: 26 additions & 0 deletions Cassiopee/CPlot/CPlot/PyTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,32 @@ def updateCPlotNumbering(t):
nb += 1
return (Nb, Nz)

#==============================================================================
# Retourne le numero global nz de la basename/zonename dans CPlot
#==============================================================================
def updateCPlotGlobalNumbering(t):
dnz = {}
# count total struct zones
nstr = 0
for b in t[2]:
if b[3] == 'CGNSBase_t':
for z in b[2]:
if z[3] == 'Zone_t':
type = Internal.getZoneType(z)
if type == 1: nstr += 1

nzs = 0 # global cplot numbering
nzu = nstr
for b in t[2]:
if b[3] == 'CGNSBase_t':
dnz[b[0]] = {}
for z in b[2]:
if z[3] == 'Zone_t':
type = Internal.getZoneType(z)
if type == 1: dnz[b[0]][z[0]] = nzs; nzs += 1
else: dnz[b[0]][z[0]] = nzu; nzu += 1
return dnz

#==============================================================================
# Retourne la numerotation CPlot de la zone baseName/zoneName de t
# IN: t: un noeud pyTree (et pas autre chose)
Expand Down
2 changes: 1 addition & 1 deletion Cassiopee/CPlot/apps/tkIBC.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def createApp(win):
B = TTK.Label(Frame, text="IBC type")
B.grid(row=2, column=0, sticky=TK.EW)
BB = CTK.infoBulle(parent=B, text='Type of Immersed Boundary Condition.')
B = TTK.OptionMenu(Frame, VARS[1], 'slip', 'noslip', 'Log', 'Musker', 'WallLaw', 'outpress', 'inj', 'TBLE', 'slip_cr', 'overlap','wiremodel','WallLawLinearized','None')
B = TTK.OptionMenu(Frame, VARS[1], 'slip', 'noslip', 'Log', 'Musker', 'SA', 'outpress', 'inj', 'TBLE', 'slip_cr', 'overlap','wiremodel','MuskerLinear','SALinear','None')
B.grid(row=2, column=1, columnspan=2, sticky=TK.EW)

# - Mask settings (in or out) -
Expand Down
Loading

0 comments on commit 179fe19

Please sign in to comment.