diff --git a/README.md b/README.md new file mode 100644 index 0000000..21d04c2 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# anisotrope-cube + +## Requirements +* python 3.5> +* OpenFOAM +* SALOME +* ParaView + +## Getting started + +* Clone project: +```bash +$ git clone git@github.com:L-Nafaryus/anisotrope-cube.git +$ cd anisotrope-cube +``` + +* Run single structure via SALOME GUI: +```bash +$ salome + +python> exec(open("PATH/simpleCubic.py").read("rb"), args=("", 0.1, "001")) +``` +where `PATH` is a full path to `anisotrope-cube/src/`. + +* Generate all structures with configured parameters: +```bash +$ python src/genmesh.py +``` + +* All meshes + calculations: +```bash +$ ./build.sh +``` diff --git a/TODO.md b/TODO.md index 7a4dceb..2499222 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,11 @@ * collapseDict: collapseEdges ## 1.03.21 -* boundary type (wall or symetryPlane) -* restruct for ways -* build alpha = 0.01 .. 0.13 -* ! symetryPlane -> cyclicAMI +[+] boundary type (wall or symetryPlane) +[+] restruct for ways +[+] build alpha = 0.01 .. 0.13 +[ ] ! symetryPlane -> cyclicAMI + +## 3.03.21 +[+] configure salome server, ports, etc. +[ ] less processes for salome, optimization. diff --git a/src/foam/0/U b/src/baseFOAM/0/U similarity index 100% rename from src/foam/0/U rename to src/baseFOAM/0/U diff --git a/src/foam/0/p b/src/baseFOAM/0/p similarity index 100% rename from src/foam/0/p rename to src/baseFOAM/0/p diff --git a/src/foam/constant/transportProperties b/src/baseFOAM/constant/transportProperties similarity index 100% rename from src/foam/constant/transportProperties rename to src/baseFOAM/constant/transportProperties diff --git a/src/foam/constant/turbulenceProperties b/src/baseFOAM/constant/turbulenceProperties similarity index 100% rename from src/foam/constant/turbulenceProperties rename to src/baseFOAM/constant/turbulenceProperties diff --git a/src/foam/system/controlDict b/src/baseFOAM/system/controlDict similarity index 100% rename from src/foam/system/controlDict rename to src/baseFOAM/system/controlDict diff --git a/src/foam/system/decomposeParDict b/src/baseFOAM/system/decomposeParDict similarity index 100% rename from src/foam/system/decomposeParDict rename to src/baseFOAM/system/decomposeParDict diff --git a/src/foam/system/fvSchemes b/src/baseFOAM/system/fvSchemes similarity index 100% rename from src/foam/system/fvSchemes rename to src/baseFOAM/system/fvSchemes diff --git a/src/foam/system/fvSolution b/src/baseFOAM/system/fvSolution similarity index 100% rename from src/foam/system/fvSolution rename to src/baseFOAM/system/fvSolution diff --git a/src/foam.py b/src/foam.py new file mode 100644 index 0000000..dfef553 --- /dev/null +++ b/src/foam.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os, shutil + + +if __name__ == "__main__": + src = os.getcwd() + build = os.path.join(src, "../build") + + if not os.path.exists(build): + os.makedirs(build) + + foamCase = [ "0", "constant", "system" ] + + for d in foamCase: + shutil.copytree("{}/foam/{}".format(src, d), + "{}/simple-cubic/0.1/{}".format(build, d)) diff --git a/src/genmesh.py b/src/genmesh.py index 2a53135..006bea0 100644 --- a/src/genmesh.py +++ b/src/genmesh.py @@ -1,24 +1,48 @@ import os import subprocess import multiprocessing +import logging +import time +from datetime import timedelta -def salome(src_path, build_path, coefficient, direction): - subprocess.run(["salome", "start", "-t", src_path, "args:{},{}".format(build_path, coefficient, direction)]) +def salome(port, src_path, build_path, coefficient, direction): + """ + Run salome and terminate after. + + Parameters: + port (int): Port for the process. + src_path (str): Path to the execution script. + build_path (str): Output path. + """ + logging.info("Starting SALOME on port {} for {}".format(port, build_path)) + subprocess.run(["salome", "start", + "--port", str(port), + "-t", src_path, + "args:{},{},{}".format(build_path, coefficient, direction)]) + + logging.info("Terminating SALOME on port {} for {}".format(port, build_path)) + subprocess.run(["salome", "kill", str(port)]) if __name__ == "__main__": # Get main paths project = os.getcwd() src = os.path.join(project, "src") build = os.path.join(project, "build") - + if not os.path.exists(build): - os.makedirs(build) + os.makedirs(build) - ### + # Logger + logging.basicConfig(filename="{}/genmesh.log".format(build), + level=logging.INFO, format="%(levelname)s: %(name)s: %(message)s") + start_time = time.monotonic() + + # Start in parallel processes = [] - structures = ["simple-cubic"] #, "bc-cubic", "fc-cubic"] + structures = ["simpleCubic"] #, "bc-cubic", "fc-cubic"] directions = ["001", "100"] coefficients = [ alpha * 0.01 for alpha in range(1, 13 + 1) ] + port = 2810 for structure in structures: for direction in directions: @@ -31,11 +55,18 @@ if __name__ == "__main__": if not os.path.exists(build_path): os.makedirs(build_path) + logging.info("{} created.".format(build_path)) - print("starting process") - p = multiprocessing.Process(target = salome, args = (src_path, build_path, coefficient, direction)) + p = multiprocessing.Process(target = salome, + args = (port, src_path, build_path, coefficient, direction)) processes.append(p) p.start() + logging.info("{} on port {}.".format(p, port)) + port += 1 for process in processes: process.join() + + end_time = time.monotonic() + logging.info("Elapsed time: {}".format(timedelta(seconds=end_time - start_time))) + diff --git a/src/prefoam.py b/src/prefoam.py deleted file mode 100644 index f06c52d..0000000 --- a/src/prefoam.py +++ /dev/null @@ -1,13 +0,0 @@ -import os, shutil - -src = os.getcwd() -build = os.path.join(src, "../build") - -if not os.path.exists(build): - os.makedirs(build) - -foamCase = [ "0", "constant", "system" ] - -for d in foamCase: - shutil.copytree("{}/foam/{}".format(src, d), - "{}/simple-cubic/0.1/{}".format(build, d)) diff --git a/src/simpleCubic.py b/src/simpleCubic.py index 2954687..2e24907 100644 --- a/src/simpleCubic.py +++ b/src/simpleCubic.py @@ -5,6 +5,9 @@ from salome.geom import geomBuilder from salome.smesh import smeshBuilder import math import os, sys +import logging +import time +from datetime import timedelta class simpleCubic: def __init__(self, name = None): @@ -303,20 +306,41 @@ class simpleCubic: print("Error: Cannot export mesh to '{}'".format(exportpath)) if __name__ == "__main__": + # Arguments buildpath = str(sys.argv[1]) alpha = float(sys.argv[2]) direction = str(sys.argv[3]) + + name = "simpleCubic-{}-{}".format(direction, alpha) - sc = simpleCubic("simpleCubic-{}-{}".format(direction, alpha)) + # Logger + logging.basicConfig(filename="{}/{}.log".format(buildpath, name), + level=logging.INFO, format="%(levelname)s: %(name)s: %(message)s") + start_time = time.monotonic() + + # Simple cubic + sc = simpleCubic(name) + + logging.info("Creating the geometry ...") sc.geometryCreate(alpha) + + logging.info("Extracting boundaries ...") sc.boundaryCreate(direction) + + logging.info("Creating the mesh ...") sc.meshCreate(2, { "thickness": 0.02, "number": 2, "stretch": 1.1 }) sc.meshCompute() - #sc.meshExport(build) - + + logging.info("Exporting the mesh ...") + sc.meshExport(buildpath) + + end_time = time.monotonic() + logging.info("Elapsed time: {}".format(timedelta(seconds=end_time - start_time))) + logging.info("Done.") + if salome.sg.hasDesktop(): salome.sg.updateObjBrowser() diff --git a/temp/geometry.back.py b/temp/geometry.back.py deleted file mode 100644 index 6b40e0a..0000000 --- a/temp/geometry.back.py +++ /dev/null @@ -1,87 +0,0 @@ -import GEOM -from salome.geom import geomBuilder -geompy = geomBuilder.New() - -import math - -def create(alpha): - # xyz axes - axes = [ - geompy.MakeVectorDXDYDZ(1, 0, 0), - geompy.MakeVectorDXDYDZ(0, 1, 0), - geompy.MakeVectorDXDYDZ(0, 0, 1) - ] - - # Main box - box = geompy.MakeBoxDXDYDZ(2 * math.sqrt(2), 2 * math.sqrt(2), 2) - box = geompy.MakeRotation(box, axes[2], 45 * math.pi / 180.0) - box = geompy.MakeTranslation(box, 2, 0, 0) - - vtx = [ - geompy.MakeVertex(2, 0, 0), - geompy.MakeVertex(2, 2, 0), - geompy.MakeVertex(2, 2, 2) - ] - - line = geompy.MakeLineTwoPnt(vtx[1], vtx[2]) - - # Spheres for cutting - sphere = geompy.MakeSpherePntR(vtx[0], 1 / (1 - alpha)) - sphere = geompy.MakeMultiTranslation1D(sphere, axes[1], 2, 3) - cut = geompy.MakeCutList(box, [sphere], True) - - sphere2 = geompy.MakeTranslation(sphere, 0, 0, 2) - cut2 = geompy.MakeCutList(cut, [sphere2], True) - - sphere3 = geompy.MakeRotation(sphere, line, 90 * math.pi / 180.0) - cut3 = geompy.MakeCutList(cut2, [sphere3], True) - - sphere4 = geompy.MakeTranslation(sphere3, 0, 0, 2) - - # Main geometry - Pore = geompy.MakeCutList(cut3, [sphere4], True) - geompy.addToStudy(Pore, "PORE") - # 1/4 of Pore - box2 = geompy.MakeBoxDXDYDZ(2, 2, 2) - box2 = geompy.MakeTranslation(box2, 2, 0, 0) - Segment1_4 = geompy.MakeCommonList([Pore, box2], True) - - # 1/8 of Pore - vec1 = geompy.MakeVector(geompy.MakeVertex(3, 1, 0), geompy.MakeVertex(3, 1, 1)) - box2 = geompy.MakeRotation(box2, vec1, 45*math.pi/180.0) - vec2 = geompy.MakeVector(geompy.MakeVertex(3, 1, 0), geompy.MakeVertex(2, 0, 0)) - box2 = geompy.MakeTranslationVectorDistance(box2, vec2, 1) - box2 = geompy.MakeTranslation(box2, -0.5, 0.5, 0) - Segment1_8 = geompy.MakeCommonList([Segment1_4, box2], True) - - # Prepare faces - vtx.append(geompy.MakeVertex(2, 2, 2)) - vtx.append(geompy.MakeVertexWithRef(vtx[3], 0, 0, 1)) - vec2 = geompy.MakeVector(vtx[3], vtx[4]) - plane = geompy.MakePlane(vtx[3], vec2, 5) - common1 = geompy.MakeCommonList([Pore, plane], True) - plane = geompy.MakeTranslation(plane, 0, 0, -2) - common2 = geompy.MakeCommonList([Pore, plane], True) - - # Main groups (inlet, outlet, wall) - inlet = geompy.CreateGroup(Pore, geompy.ShapeType["FACE"]) - gip = geompy.GetInPlace(Pore, common1, True) - #faces = geompy.SubShapeAllIDs(gip, geompy.ShapeType["FACE"]) - #geompy.UnionIDs(inlet, faces) - faces = geompy.SubShapeAll(gip, geompy.ShapeType["FACE"]) - geompy.UnionList(inlet, faces) - #geompy.addToStudyInFather(Pore, inlet, "inletich") - - outlet = geompy.CreateGroup(Pore, geompy.ShapeType["FACE"]) - gip = geompy.GetInPlace(Pore, common2, True) - faces = geompy.SubShapeAll(gip, geompy.ShapeType["FACE"]) - geompy.UnionList(outlet, faces) - - PoreGroup = geompy.CreateGroup(Pore, geompy.ShapeType["FACE"]) - faces = geompy.SubShapeAllIDs(Pore, geompy.ShapeType["FACE"]) - geompy.UnionIDs(PoreGroup, faces) - - wall = geompy.CutListOfGroups([PoreGroup], [inlet, outlet]) - - - return Pore, [inlet, outlet, wall] diff --git a/temp/mesh.back.py b/temp/mesh.back.py deleted file mode 100644 index 9049e0c..0000000 --- a/temp/mesh.back.py +++ /dev/null @@ -1,34 +0,0 @@ -import SMESH, SALOMEDS -from salome.smesh import smeshBuilder -smesh = smeshBuilder.New() - - -def create(geomObj, bc): - mesh = smesh.Mesh(geomObj) - netgen = mesh.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) - - param = netgen.Parameters() - param.SetSecondOrder( 0 ) - param.SetOptimize( 1 ) - param.SetChordalError( -1 ) - param.SetChordalErrorEnabled( 0 ) - param.SetUseSurfaceCurvature( 1 ) - param.SetFuseEdges( 1 ) - param.SetCheckChartBoundary( 0 ) - param.SetMinSize( 0.01 ) - param.SetMaxSize( 0.1 ) - param.SetFineness( 4 ) - #param.SetGrowthRate( 0.1 ) - #param.SetNbSegPerEdge( 5 ) - #param.SetNbSegPerRadius( 10 ) - param.SetQuadAllowed( 0 ) - - vlayer = netgen.ViscousLayers(0.025, 2, 1.1, [], - 1, smeshBuilder.NODE_OFFSET) - - mesh.GroupOnGeom(bc[0], 'inlet', SMESH.FACE) - mesh.GroupOnGeom(bc[1], 'outlet', SMESH.FACE) - mesh.GroupOnGeom(bc[2], 'wall', SMESH.FACE) - - return mesh - diff --git a/worksheet/cube_010320.py b/worksheet/cube_010320.py deleted file mode 100644 index cc6d2e1..0000000 --- a/worksheet/cube_010320.py +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env python - -### -### This file is generated automatically by SALOME v9.6.0 with dump python functionality -### - -import sys -import salome - -salome.salome_init() -import salome_notebook -notebook = salome_notebook.NoteBook() -sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet') - -### -### GEOM component -### - -import GEOM -from salome.geom import geomBuilder -import math -import SALOMEDS - - -geompy = geomBuilder.New() - -geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0) -geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0) -geomObj_7 = geompy.MakeVertex(2, 0, 0) -geomObj_8 = geompy.MakeVertex(2, 2, 0) -geomObj_9 = geompy.MakeVertex(2, 2, 2) -geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9) -geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111) -geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3) -geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True) -geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2) -geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True) -geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0) -geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True) -geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2) -PORE = geompy.MakeCutList(geomObj_17, [geomObj_18], True) -geomObj_19 = geompy.MakeVertex(2, 2, 2) -geomObj_20 = geompy.MakeVertexWithRef(geomObj_19, 0, 0, 1) -geomObj_21 = geompy.MakeVector(geomObj_19, geomObj_20) -geomObj_22 = geompy.MakePlane(geomObj_19, geomObj_21, 5) -geomObj_23 = geompy.MakeCommonList([PORE, geomObj_22], True) -geomObj_24 = geompy.MakeTranslation(geomObj_22, 0, 0, -2) -geomObj_25 = geompy.MakeCommonList([PORE, geomObj_24], True) - -inlet = geompy.CreateGroup(PORE, geompy.ShapeType["FACE"]) -geomObj_26 = geompy.GetInPlace(PORE, geomObj_23, True) -[geomObj_27,geomObj_28,geomObj_29,geomObj_30] = geompy.SubShapeAll(geomObj_26, geompy.ShapeType["FACE"]) -geompy.UnionList(inlet, [geomObj_27, geomObj_28, geomObj_29, geomObj_30]) -outlet = geompy.CreateGroup(PORE, geompy.ShapeType["FACE"]) -geomObj_31 = geompy.GetInPlace(PORE, geomObj_25, True) -[geomObj_32,geomObj_33,geomObj_34,geomObj_35] = geompy.SubShapeAll(geomObj_31, geompy.ShapeType["FACE"]) -geompy.UnionList(outlet, [geomObj_32, geomObj_33, geomObj_34, geomObj_35]) - -geomObj_36 = geompy.CreateGroup(PORE, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_36, [3, 17, 28, 33, 42, 51, 56, 63, 72, 77, 90, 95, 102, 107, 117, 120, 129, 136, 142, 149, 156, 159, 162, 165]) -wall = geompy.CutListOfGroups([geomObj_36], [inlet, outlet]) - -Fillet_1 = geompy.MakeFillet(PORE, 0.1, geompy.ShapeType["EDGE"], [24, 27, 35, 41, 48, 58, 82, 85, 89, 109, 114, 122, 128, 135, 140, 141, 148, 155]) - -inlet_1 = geompy.CreateGroup(Fillet_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(inlet_1, [138, 37, 96, 269]) -outlet_1 = geompy.CreateGroup(Fillet_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(outlet_1, [64, 172, 126, 262]) -wall_1 = geompy.CutListOfGroups([geomObj_37], [inlet_1, outlet_1]) -geompy.addToStudy( PORE, 'PORE' ) -geompy.addToStudyInFather( PORE, inlet, 'inlet' ) -geompy.addToStudyInFather( PORE, outlet, 'outlet' ) -geompy.addToStudyInFather( PORE, wall, 'wall' ) -geompy.addToStudy( Fillet_1, 'Fillet_1' ) -geompy.addToStudyInFather( Fillet_1, inlet_1, 'inlet' ) -geompy.addToStudyInFather( Fillet_1, outlet_1, 'outlet' ) -geompy.addToStudyInFather( Fillet_1, wall_1, 'wall' ) - -### -### SMESH component -### - -import SMESH, SALOMEDS -from salome.smesh import smeshBuilder - -smesh = smeshBuilder.New() -#smesh.SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations: - # multiples meshes built in parallel, complex and numerous mesh edition (performance) - -PORE_1 = smesh.Mesh(PORE) -NETGEN_2D3D_1 = PORE_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -NETGEN_Parameters = NETGEN_2D3D_1.Parameters() -NETGEN_Parameters.SetSecondOrder( 0 ) -NETGEN_Parameters.SetOptimize( 1 ) -NETGEN_Parameters.SetChordalError( -1 ) -NETGEN_Parameters.SetChordalErrorEnabled( 0 ) -NETGEN_Parameters.SetUseSurfaceCurvature( 1 ) -NETGEN_Parameters.SetFuseEdges( 1 ) -NETGEN_Parameters.SetCheckChartBoundary( 0 ) -NETGEN_Parameters.SetMinSize( 0.01 ) -NETGEN_Parameters.SetMaxSize( 0.1 ) -NETGEN_Parameters.SetFineness( 4 ) -NETGEN_Parameters.SetQuadAllowed( 0 ) -ViscousLayers_0_025 = NETGEN_2D3D_1.ViscousLayers(0.025,2,1.1,[],1,smeshBuilder.NODE_OFFSET) -inlet_2 = PORE_1.GroupOnGeom(inlet,'inlet',SMESH.FACE) -outlet_2 = PORE_1.GroupOnGeom(outlet,'outlet',SMESH.FACE) -wall_2 = PORE_1.GroupOnGeom(wall,'wall',SMESH.FACE) -isDone = PORE_1.Compute() -try: - PORE_1.ExportUNV( r'asd/mesh.unv' ) - pass -except: - print('ExportUNV() failed. Invalid file name?') -NETGEN_Parameters.SetFineness( 3 ) -Mesh_1 = smesh.Mesh(Fillet_1) -status = Mesh_1.AddHypothesis(NETGEN_Parameters) -status = Mesh_1.AddHypothesis(ViscousLayers_0_025) -NETGEN_2D3D_1_1 = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -inlet_3 = Mesh_1.GroupOnGeom(inlet_1,'inlet',SMESH.FACE) -outlet_3 = Mesh_1.GroupOnGeom(outlet_1,'outlet',SMESH.FACE) -wall_3 = Mesh_1.GroupOnGeom(wall_1,'wall',SMESH.FACE) -ViscousLayers_0_025.SetTotalThickness( 0.05 ) -ViscousLayers_0_025.SetNumberLayers( 2 ) -ViscousLayers_0_025.SetStretchFactor( 1.1 ) -ViscousLayers_0_025.SetMethod( smeshBuilder.SURF_OFFSET_SMOOTH ) -ViscousLayers_0_025.SetFaces( [], 1 ) -isDone = Mesh_1.Compute() -[ inlet_3, outlet_3, wall_3 ] = Mesh_1.GetGroups() -try: - Mesh_1.ExportUNV( r'/home/nafaryus/projects/anisotrope-cube/build/simple-cubic/0.1/mesh.unv' ) - pass -except: - print('ExportUNV() failed. Invalid file name?') - - -## Set names of Mesh objects -smesh.SetName(NETGEN_2D3D_1.GetAlgorithm(), 'NETGEN_2D3D_1') -smesh.SetName(ViscousLayers_0_025, 'ViscousLayers=0.025,2,1.1,[],1') -smesh.SetName(NETGEN_Parameters, 'NETGEN_Parameters') -smesh.SetName(inlet_2, 'inlet') -smesh.SetName(outlet_2, 'outlet') -smesh.SetName(wall_2, 'wall') -smesh.SetName(PORE_1.GetMesh(), 'PORE') -smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1') -smesh.SetName(wall_3, 'wall') -smesh.SetName(outlet_3, 'outlet') -smesh.SetName(inlet_3, 'inlet') - - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser() diff --git a/worksheet/cube_020320.py b/worksheet/cube_020320.py deleted file mode 100644 index d512a23..0000000 --- a/worksheet/cube_020320.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -### -### This file is generated automatically by SALOME v9.6.0 with dump python functionality -### - -import sys -import salome - -salome.salome_init() -import salome_notebook -notebook = salome_notebook.NoteBook() -sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet') - -### -### GEOM component -### - -import GEOM -from salome.geom import geomBuilder -import math -import SALOMEDS - - -geompy = geomBuilder.New() - -geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0) -geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0) -geomObj_7 = geompy.MakeVertex(2, 0, 0) -geomObj_8 = geompy.MakeVertex(2, 2, 0) -geomObj_9 = geompy.MakeVertex(2, 2, 2) -geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9) -geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111) -geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3) -geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True) -geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2) -geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True) -geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0) -geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True) -geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2) -simpleCubic_100_0_1 = geompy.MakeCutList(geomObj_17, [geomObj_18], True) -Sphere_1 = geompy.MakeSphereR(1) -Translation_1 = geompy.MakeTranslation(Sphere_1, 1.9, 0, 0) -geomObj_19 = geompy.MakeGlueFaces([Sphere_1, Translation_1], 1e-07) -Fuse_1 = geompy.MakeFuseList([Sphere_1, Translation_1], True, True) -Fillet_1 = geompy.MakeFilletAll(Fuse_1, 0.1) -Multi_Translation_1 = geompy.MakeMultiTranslation2D(Sphere_1, None, 1.9, 3, None, 1.9, 3) -[Solid_1,Solid_2,Solid_3,Solid_4,Solid_5,Solid_6,Solid_7,Solid_8,Solid_9] = geompy.ExtractShapes(Multi_Translation_1, geompy.ShapeType["SOLID"], True) -Fuse_2 = geompy.MakeFuseList([Solid_1, Solid_2, Solid_3, Solid_4, Solid_5, Solid_6, Solid_7, Solid_8, Solid_9], True, True) -Fillet_2 = geompy.MakeFilletAll(Fuse_2, 0.1) -geompy.addToStudy( simpleCubic_100_0_1, 'simpleCubic-100-0.1' ) -geompy.addToStudy( Sphere_1, 'Sphere_1' ) -geompy.addToStudy( Translation_1, 'Translation_1' ) -geompy.addToStudy( Fuse_1, 'Fuse_1' ) -geompy.addToStudy( Fillet_1, 'Fillet_1' ) -geompy.addToStudy( Multi_Translation_1, 'Multi-Translation_1' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_1, 'Solid_1' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_2, 'Solid_2' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_3, 'Solid_3' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_4, 'Solid_4' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_5, 'Solid_5' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_6, 'Solid_6' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_7, 'Solid_7' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_8, 'Solid_8' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_9, 'Solid_9' ) -geompy.addToStudy( Fuse_2, 'Fuse_2' ) -geompy.addToStudy( Fillet_2, 'Fillet_2' ) - - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser() diff --git a/worksheet/cube_020320_2.py b/worksheet/cube_020320_2.py deleted file mode 100644 index ca11720..0000000 --- a/worksheet/cube_020320_2.py +++ /dev/null @@ -1,247 +0,0 @@ -#!/usr/bin/env python - -### -### This file is generated automatically by SALOME v9.6.0 with dump python functionality -### - -import sys -import salome - -salome.salome_init() -import salome_notebook -notebook = salome_notebook.NoteBook() -sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet') - -### -### GEOM component -### - -import GEOM -from salome.geom import geomBuilder -import math -import SALOMEDS - - -geompy = geomBuilder.New() - -geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0) -geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0) -geomObj_7 = geompy.MakeVertex(2, 0, 0) -geomObj_8 = geompy.MakeVertex(2, 2, 0) -geomObj_9 = geompy.MakeVertex(2, 2, 2) -geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9) -geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111) -geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3) -geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True) -geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2) -geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True) -geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0) -geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True) -geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2) -simpleCubic_100_0_1 = geompy.MakeCutList(geomObj_17, [geomObj_18], True) -Sphere_1 = geompy.MakeSphereR(1) -Translation_1 = geompy.MakeTranslation(Sphere_1, 1.9, 0, 0) -geomObj_19 = geompy.MakeGlueFaces([Sphere_1, Translation_1], 1e-07) -Fuse_1 = geompy.MakeFuseList([Sphere_1, Translation_1], True, True) -Fillet_1 = geompy.MakeFilletAll(Fuse_1, 0.1) -Multi_Translation_1 = geompy.MakeMultiTranslation2D(Sphere_1, None, 1.9, 3, None, 1.9, 3) -[Solid_1,Solid_2,Solid_3,Solid_4,Solid_5,Solid_6,Solid_7,Solid_8,Solid_9] = geompy.ExtractShapes(Multi_Translation_1, geompy.ShapeType["SOLID"], True) -Fuse_2 = geompy.MakeFuseList([Solid_1, Solid_2, Solid_3, Solid_4, Solid_5, Solid_6, Solid_7, Solid_8, Solid_9], True, True) -Fillet_2 = geompy.MakeFilletAll(Fuse_2, 0.1) -geomObj_20 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_21 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_22 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_23 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_24 = geompy.MakeRotation(geomObj_23, geomObj_22, 45*math.pi/180.0) -geomObj_25 = geompy.MakeTranslation(geomObj_24, 2, 0, 0) -geomObj_26 = geompy.MakeVertex(2, 0, 0) -geomObj_27 = geompy.MakeVertex(2, 2, 0) -geomObj_28 = geompy.MakeVertex(2, 2, 2) -geomObj_29 = geompy.MakeLineTwoPnt(geomObj_27, geomObj_28) -geomObj_30 = geompy.MakeSpherePntR(geomObj_26, 1.111111111111111) -geomObj_31 = geompy.MakeMultiTranslation1D(geomObj_30, geomObj_21, 2, 3) -[geomObj_32,geomObj_33,geomObj_34] = geompy.ExtractShapes(geomObj_31, geompy.ShapeType["SOLID"], True) -geomObj_35 = geompy.MakeFuseList([geomObj_32, geomObj_33, geomObj_34], True, True) -geomObj_36 = geompy.MakeFilletAll(geomObj_35, 0.1) -geomObj_37 = geompy.MakeCutList(geomObj_25, [geomObj_36], True) -geomObj_38 = geompy.MakeTranslation(geomObj_36, 0, 0, 2) -geomObj_39 = geompy.MakeCutList(geomObj_37, [geomObj_38], True) -geomObj_40 = geompy.MakeRotation(geomObj_36, geomObj_29, 90*math.pi/180.0) -geomObj_41 = geompy.MakeCutList(geomObj_39, [geomObj_40], True) -geomObj_42 = geompy.MakeTranslation(geomObj_40, 0, 0, 2) -simpleCubic_100_0_1_1 = geompy.MakeCutList(geomObj_41, [geomObj_42], True) -Multi_Translation_2 = geompy.MakeMultiTranslation1D(Sphere_1, None, 2, 3) -geomObj_43 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_44 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_45 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_46 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_47 = geompy.MakeRotation(geomObj_46, geomObj_45, 45*math.pi/180.0) -geomObj_48 = geompy.MakeTranslation(geomObj_47, 2, 0, 0) -geomObj_49 = geompy.MakeVertex(2, 0, 0) -geomObj_50 = geompy.MakeVertex(2, 2, 0) -geomObj_51 = geompy.MakeVertex(2, 2, 2) -geomObj_52 = geompy.MakeLineTwoPnt(geomObj_50, geomObj_51) -geomObj_53 = geompy.MakeSpherePntR(geomObj_49, 1.111111111111111) -geomObj_54 = geompy.MakeMultiTranslation1D(geomObj_53, geomObj_44, 2, 3) -[geomObj_55,geomObj_56,geomObj_57] = geompy.ExtractShapes(geomObj_54, geompy.ShapeType["SOLID"], True) -geomObj_58 = geompy.MakeFuseList([geomObj_55, geomObj_56, geomObj_57], True, True) -sphere = geompy.MakeFilletAll(geomObj_58, 0.1) -geomObj_59 = geompy.MakeCutList(geomObj_48, [sphere], True) -sphere2 = geompy.MakeTranslation(sphere, 0, 0, 2) -geomObj_60 = geompy.MakeCutList(geomObj_59, [sphere2], True) -sphere3 = geompy.MakeRotation(sphere, geomObj_52, 90*math.pi/180.0) -geomObj_61 = geompy.MakeCutList(geomObj_60, [sphere3], True) -sphere4 = geompy.MakeTranslation(sphere3, 0, 0, 2) -simpleCubic_100_0_1_2 = geompy.MakeCutList(geomObj_61, [sphere4], True) -Sphere_2 = geompy.MakeSphereR(1.111111) -Multi_Translation_3 = geompy.MakeMultiTranslation2D(Sphere_2, None, 2, 3, None, 2, 3) -Translation_2 = geompy.MakeTranslation(Multi_Translation_3, 0, 0, 2) -geomObj_62 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_63 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_64 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_65 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_66 = geompy.MakeRotation(geomObj_65, geomObj_64, 45*math.pi/180.0) -geomObj_67 = geompy.MakeTranslation(geomObj_66, 2, 0, 0) -geomObj_68 = geompy.MakeVertex(2, 0, 0) -geomObj_69 = geompy.MakeVertex(2, 2, 0) -geomObj_70 = geompy.MakeVertex(2, 2, 2) -geomObj_71 = geompy.MakeLineTwoPnt(geomObj_69, geomObj_70) -geomObj_72 = geompy.MakeSpherePntR(geomObj_68, 1.111111111111111) -geomObj_73 = geompy.MakeMultiTranslation2D(geomObj_72, None, 2, 3, None, 2, 3) -geomObj_74 = geompy.MakeTranslation(geomObj_73, 0, 0, 2) -[geomObj_75,geomObj_76,geomObj_77,geomObj_78,geomObj_79,geomObj_80,geomObj_81,geomObj_82,geomObj_83] = geompy.ExtractShapes(geomObj_74, geompy.ShapeType["SOLID"], True) -geomObj_84 = geompy.MakeFuseList([geomObj_75, geomObj_76, geomObj_77, geomObj_78, geomObj_79, geomObj_80, geomObj_81, geomObj_82, geomObj_83], True, True) -sphere_1 = geompy.MakeFilletAll(geomObj_84, 0.1) -simpleCubic_100_0_1_3 = geompy.MakeCutList(geomObj_67, [sphere_1], True) -geomObj_85 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_86 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_87 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_88 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_89 = geompy.MakeRotation(geomObj_88, geomObj_87, 45*math.pi/180.0) -geomObj_90 = geompy.MakeTranslation(geomObj_89, 2, 0, 0) -geomObj_91 = geompy.MakeVertex(2, 0, 0) -geomObj_92 = geompy.MakeVertex(2, 2, 0) -geomObj_93 = geompy.MakeVertex(2, 2, 2) -geomObj_94 = geompy.MakeLineTwoPnt(geomObj_92, geomObj_93) -geomObj_95 = geompy.MakeSpherePntR(geomObj_91, 1.111111111111111) -geomObj_96 = geompy.MakeMultiTranslation2D(geomObj_95, None, 2, 3, None, 2, 3) -[geomObj_97,geomObj_98,geomObj_99,geomObj_100,geomObj_101,geomObj_102,geomObj_103,geomObj_104,geomObj_105] = geompy.ExtractShapes(geomObj_96, geompy.ShapeType["SOLID"], True) -geomObj_106 = geompy.MakeTranslation(geomObj_96, 0, 0, 2) -[geomObj_107,geomObj_108,geomObj_109,geomObj_110,geomObj_111,geomObj_112,geomObj_113,geomObj_114,geomObj_115] = geompy.ExtractShapes(geomObj_106, geompy.ShapeType["SOLID"], True) -geomObj_116 = geompy.MakeFuseList([geomObj_97, geomObj_98, geomObj_99, geomObj_100, geomObj_101, geomObj_102, geomObj_103, geomObj_104, geomObj_105, geomObj_107, geomObj_108, geomObj_109, geomObj_110, geomObj_111, geomObj_112, geomObj_113, geomObj_114, geomObj_115], True, True) -sphere_2 = geompy.MakeFilletAll(geomObj_116, 0.1) -simpleCubic_100_0_1_4 = geompy.MakeCutList(geomObj_90, [sphere_2], True) -Translation_3 = geompy.MakeTranslation(sphere_2, -2, 0, 0) -geomObj_117 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_118 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_119 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_120 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_121 = geompy.MakeRotation(geomObj_120, geomObj_119, 45*math.pi/180.0) -geomObj_122 = geompy.MakeTranslation(geomObj_121, 2, 0, 0) -geomObj_123 = geompy.MakeVertex(2, 0, 0) -geomObj_124 = geompy.MakeVertex(2, 2, 0) -geomObj_125 = geompy.MakeVertex(2, 2, 2) -geomObj_126 = geompy.MakeLineTwoPnt(geomObj_124, geomObj_125) -geomObj_127 = geompy.MakeSpherePntR(geomObj_123, 1.111111111111111) -geomObj_128 = geompy.MakeMultiTranslation2D(geomObj_127, None, 2, 3, None, 2, 3) -geomObj_129 = geompy.MakeTranslation(geomObj_128, -2, 0, 0) -[geomObj_130,geomObj_131,geomObj_132,geomObj_133,geomObj_134,geomObj_135,geomObj_136,geomObj_137,geomObj_138] = geompy.ExtractShapes(geomObj_129, geompy.ShapeType["SOLID"], True) -geomObj_139 = geompy.MakeTranslation(geomObj_129, 0, 0, 2) -[geomObj_140,geomObj_141,geomObj_142,geomObj_143,geomObj_144,geomObj_145,geomObj_146,geomObj_147,geomObj_148] = geompy.ExtractShapes(geomObj_139, geompy.ShapeType["SOLID"], True) -geomObj_149 = geompy.MakeFuseList([geomObj_130, geomObj_131, geomObj_132, geomObj_133, geomObj_134, geomObj_135, geomObj_136, geomObj_137, geomObj_138, geomObj_140, geomObj_141, geomObj_142, geomObj_143, geomObj_144, geomObj_145, geomObj_146, geomObj_147, geomObj_148], True, True) -sphere_3 = geompy.MakeFilletAll(geomObj_149, 0.1) -simpleCubic_100_0_1_5 = geompy.MakeCutList(geomObj_122, [sphere_3], True) -[geomObj_150,geomObj_151,geomObj_152,geomObj_153,geomObj_154,geomObj_155,geomObj_156,geomObj_157,geomObj_158,Common_1,from_Face_4,inlet,geomObj_159,geomObj_160,Group_1,geomObj_161,geomObj_162,geomObj_163,geomObj_164,Group_2,geomObj_165,geomObj_166,geomObj_167,geomObj_168,geomObj_169,geomObj_170,geomObj_171,geomObj_172,geomObj_173,geomObj_174,geomObj_175,geomObj_176,geomObj_177,geomObj_178,geomObj_179,geomObj_180,geomObj_181,geomObj_182,geomObj_183,geomObj_184,geomObj_185,geomObj_186,geomObj_187,geomObj_188] = geompy.ExtractShapes(simpleCubic_100_0_1_5, geompy.ShapeType["FACE"], True) -geomObj_189 = geompy.MakeVertex(0, 0, 0) -geomObj_190 = geompy.MakeVertex(5, 5, 5) -Vertex_1 = geompy.MakeVertex(2, 2, 0) -Vertex_2 = geompy.MakeVertex(2, 2, 2) -Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2) -O = geompy.MakeVertex(0, 0, 0) -OX = geompy.MakeVectorDXDYDZ(1, 0, 0) -OY = geompy.MakeVectorDXDYDZ(0, 1, 0) -OZ = geompy.MakeVectorDXDYDZ(0, 0, 1) -Rotation_1 = geompy.MakeRotationThreePoints(Vector_1, Vertex_1, O, O) -Box_1 = geompy.MakeBoxDXDYDZ(2.828427, 2.828427, 2) -Rotation_2 = geompy.MakeRotation(Box_1, OZ, -45*math.pi/180.0) -Translation_4 = geompy.MakeTranslation(Rotation_2, 0, 2, 0) -[Face_1,Face_2,Face_3,Face_4,Face_5,Face_6] = geompy.ExtractShapes(Translation_4, geompy.ShapeType["FACE"], True) -[geomObj_162] = geompy.SubShapeAll(Face_1, geompy.ShapeType["FACE"]) -[geomObj_163] = geompy.SubShapeAll(Face_1, geompy.ShapeType["FACE"]) -Common_1 = geompy.MakeCommonList([simpleCubic_100_0_1_5, Face_4], True) -geompy.addToStudy( simpleCubic_100_0_1, 'simpleCubic-100-0.1' ) -geompy.addToStudy( Sphere_1, 'Sphere_1' ) -geompy.addToStudy( Translation_1, 'Translation_1' ) -geompy.addToStudy( Fuse_1, 'Fuse_1' ) -geompy.addToStudy( Fillet_1, 'Fillet_1' ) -geompy.addToStudy( Multi_Translation_1, 'Multi-Translation_1' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_1, 'Solid_1' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_2, 'Solid_2' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_3, 'Solid_3' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_4, 'Solid_4' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_5, 'Solid_5' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_6, 'Solid_6' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_7, 'Solid_7' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_8, 'Solid_8' ) -geompy.addToStudyInFather( Multi_Translation_1, Solid_9, 'Solid_9' ) -geompy.addToStudy( Fuse_2, 'Fuse_2' ) -geompy.addToStudy( Fillet_2, 'Fillet_2' ) -geompy.addToStudy( simpleCubic_100_0_1_1, 'simpleCubic-100-0.1' ) -geompy.addToStudy( Multi_Translation_2, 'Multi-Translation_2' ) -geompy.addToStudy( sphere, 'sphere' ) -geompy.addToStudy( sphere2, 'sphere2' ) -geompy.addToStudy( sphere3, 'sphere3' ) -geompy.addToStudy( sphere4, 'sphere4' ) -geompy.addToStudy( simpleCubic_100_0_1_2, 'simpleCubic-100-0.1' ) -geompy.addToStudy( Sphere_2, 'Sphere_2' ) -geompy.addToStudy( Multi_Translation_3, 'Multi-Translation_3' ) -geompy.addToStudy( Translation_2, 'Translation_2' ) -geompy.addToStudy( sphere_1, 'sphere' ) -geompy.addToStudy( simpleCubic_100_0_1_3, 'simpleCubic-100-0.1' ) -geompy.addToStudy( sphere_2, 'sphere' ) -geompy.addToStudy( simpleCubic_100_0_1_4, 'simpleCubic-100-0.1' ) -geompy.addToStudy( Translation_3, 'Translation_3' ) -geompy.addToStudy( sphere_3, 'sphere' ) -geompy.addToStudy( simpleCubic_100_0_1_5, 'simpleCubic-100-0.1' ) -geompy.addToStudy( Vertex_1, 'Vertex_1' ) -geompy.addToStudy( Vertex_2, 'Vertex_2' ) -geompy.addToStudy( Vector_1, 'Vector_1' ) -geompy.addToStudy( OX, 'OX' ) -geompy.addToStudy( O, 'O' ) -geompy.addToStudy( OY, 'OY' ) -geompy.addToStudy( OZ, 'OZ' ) -geompy.addToStudy( Rotation_1, 'Rotation_1' ) -geompy.addToStudy( Box_1, 'Box_1' ) -geompy.addToStudy( Rotation_2, 'Rotation_2' ) -geompy.addToStudy( Translation_4, 'Translation_4' ) -geompy.addToStudyInFather( Translation_4, Face_2, 'Face_2' ) -geompy.addToStudyInFather( Translation_4, Face_1, 'Face_1' ) -geompy.addToStudyInFather( Translation_4, Face_3, 'Face_3' ) -geompy.addToStudyInFather( Translation_4, Face_4, 'Face_4' ) -geompy.addToStudyInFather( Translation_4, Face_5, 'Face_5' ) -geompy.addToStudyInFather( Translation_4, Face_6, 'Face_6' ) -geompy.addToStudy( Common_1, 'Common_1' ) -geompy.addToStudyInFather( Common_1, from_Face_4, 'from_Face_4' ) -geompy.addToStudyInFather( Common_1, inlet, 'inlet' ) -geompy.addToStudyInFather( Translation_4, Group_1, 'Group_1' ) -geompy.addToStudyInFather( Translation_4, Group_2, 'Group_2' ) -[from_Face_4] = geompy.RestoreGivenSubShapes(Common_1, [Face_4], GEOM.FSM_GetInPlace, False, True) -inlet = geompy.CreateGroup(Common_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(inlet, [2, 16, 30, 44]) -geomObj_159 = geompy.GetInPlace(simpleCubic_100_0_1_5, Face_1, True) -[geomObj_160] = geompy.SubShapeAll(geomObj_159, geompy.ShapeType["FACE"]) -[geomObj_161] = geompy.SubShapeAll(geomObj_159, geompy.ShapeType["FACE"]) -Group_1 = geompy.CreateGroup(Translation_4, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_1, [3]) -geomObj_150 = geompy.GetInPlace(Translation_4, Face_6, True) -[geomObj_164] = geompy.SubShapeAll(geomObj_150, geompy.ShapeType["FACE"]) -Group_2 = geompy.CreateGroup(Translation_4, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_2, [23, 3, 31, 33, 13, 27]) - - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser() diff --git a/worksheet/cube_150221.hdf b/worksheet/cube_150221.hdf deleted file mode 100644 index 361c05c..0000000 Binary files a/worksheet/cube_150221.hdf and /dev/null differ diff --git a/worksheet/cube_160220.py b/worksheet/cube_160220.py deleted file mode 100644 index 34c5b60..0000000 --- a/worksheet/cube_160220.py +++ /dev/null @@ -1,293 +0,0 @@ -#!/usr/bin/env python - -### -### This file is generated automatically by SALOME v9.6.0 with dump python functionality -### - -import sys -import salome - -salome.salome_init() -import salome_notebook -notebook = salome_notebook.NoteBook() -sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet') - -### -### GEOM component -### - -import GEOM -from salome.geom import geomBuilder -import math -import SALOMEDS - - -geompy = geomBuilder.New() - -geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0) -geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0) -geomObj_7 = geompy.MakeVertex(2, 0, 0) -geomObj_8 = geompy.MakeVertex(2, 2, 0) -geomObj_9 = geompy.MakeVertex(2, 2, 2) -geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9) -geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111) -geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3) -geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True) -geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2) -geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True) -geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0) -geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True) -geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2) -Pore_0_1 = geompy.MakeCutList(geomObj_17, [geomObj_18], True) -geomObj_19 = geompy.MakeBoxDXDYDZ(2, 2, 2) -geomObj_20 = geompy.MakeTranslation(geomObj_19, 2, 0, 0) -geomObj_21 = geompy.MakeCommonList([Pore_0_1, geomObj_20], True) -geomObj_22 = geompy.MakeVertex(3, 1, 0) -geomObj_23 = geompy.MakeVertex(3, 1, 1) -geomObj_24 = geompy.MakeVector(geomObj_22, geomObj_23) -geomObj_25 = geompy.MakeRotation(geomObj_20, geomObj_24, 45*math.pi/180.0) -geomObj_26 = geompy.MakeVertex(3, 1, 0) -geomObj_27 = geompy.MakeVertex(2, 0, 0) -geomObj_28 = geompy.MakeVector(geomObj_26, geomObj_27) -geomObj_29 = geompy.MakeTranslationVectorDistance(geomObj_25, geomObj_28, 1) -geomObj_30 = geompy.MakeTranslation(geomObj_29, -0.5, 0.5, 0) -geomObj_31 = geompy.MakeCommonList([geomObj_21, geomObj_30], True) -geomObj_32 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_33 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_34 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_35 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_36 = geompy.MakeRotation(geomObj_35, geomObj_34, 45*math.pi/180.0) -geomObj_37 = geompy.MakeTranslation(geomObj_36, 2, 0, 0) -geomObj_38 = geompy.MakeVertex(2, 0, 0) -geomObj_39 = geompy.MakeVertex(2, 2, 0) -geomObj_40 = geompy.MakeVertex(2, 2, 2) -geomObj_41 = geompy.MakeLineTwoPnt(geomObj_39, geomObj_40) -geomObj_42 = geompy.MakeSpherePntR(geomObj_38, 1.176470588235294) -geomObj_43 = geompy.MakeMultiTranslation1D(geomObj_42, geomObj_33, 2, 3) -geomObj_44 = geompy.MakeCutList(geomObj_37, [geomObj_43], True) -geomObj_45 = geompy.MakeTranslation(geomObj_43, 0, 0, 2) -geomObj_46 = geompy.MakeCutList(geomObj_44, [geomObj_45], True) -geomObj_47 = geompy.MakeRotation(geomObj_43, geomObj_41, 90*math.pi/180.0) -geomObj_48 = geompy.MakeCutList(geomObj_46, [geomObj_47], True) -geomObj_49 = geompy.MakeTranslation(geomObj_47, 0, 0, 2) -Pore_0_15 = geompy.MakeCutList(geomObj_48, [geomObj_49], True) -geomObj_50 = geompy.MakeBoxDXDYDZ(2, 2, 2) -geomObj_51 = geompy.MakeTranslation(geomObj_50, 2, 0, 0) -geomObj_52 = geompy.MakeCommonList([Pore_0_15, geomObj_51], True) -geomObj_53 = geompy.MakeVertex(3, 1, 0) -geomObj_54 = geompy.MakeVertex(3, 1, 1) -geomObj_55 = geompy.MakeVector(geomObj_53, geomObj_54) -geomObj_56 = geompy.MakeRotation(geomObj_51, geomObj_55, 45*math.pi/180.0) -geomObj_57 = geompy.MakeVertex(3, 1, 0) -geomObj_58 = geompy.MakeVertex(2, 0, 0) -geomObj_59 = geompy.MakeVector(geomObj_57, geomObj_58) -geomObj_60 = geompy.MakeTranslationVectorDistance(geomObj_56, geomObj_59, 1) -geomObj_61 = geompy.MakeTranslation(geomObj_60, -0.5, 0.5, 0) -geomObj_62 = geompy.MakeCommonList([geomObj_52, geomObj_61], True) -geomObj_63 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_64 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_65 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_66 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_67 = geompy.MakeRotation(geomObj_66, geomObj_65, 45*math.pi/180.0) -geomObj_68 = geompy.MakeTranslation(geomObj_67, 2, 0, 0) -geomObj_69 = geompy.MakeVertex(2, 0, 0) -geomObj_70 = geompy.MakeVertex(2, 2, 0) -geomObj_71 = geompy.MakeVertex(2, 2, 2) -geomObj_72 = geompy.MakeLineTwoPnt(geomObj_70, geomObj_71) -geomObj_73 = geompy.MakeSpherePntR(geomObj_69, 1.25) -geomObj_74 = geompy.MakeMultiTranslation1D(geomObj_73, geomObj_64, 2, 3) -geomObj_75 = geompy.MakeCutList(geomObj_68, [geomObj_74], True) -geomObj_76 = geompy.MakeTranslation(geomObj_74, 0, 0, 2) -geomObj_77 = geompy.MakeCutList(geomObj_75, [geomObj_76], True) -geomObj_78 = geompy.MakeRotation(geomObj_74, geomObj_72, 90*math.pi/180.0) -geomObj_79 = geompy.MakeCutList(geomObj_77, [geomObj_78], True) -geomObj_80 = geompy.MakeTranslation(geomObj_78, 0, 0, 2) -Pore_0_2 = geompy.MakeCutList(geomObj_79, [geomObj_80], True) -geomObj_81 = geompy.MakeBoxDXDYDZ(2, 2, 2) -geomObj_82 = geompy.MakeTranslation(geomObj_81, 2, 0, 0) -geomObj_83 = geompy.MakeCommonList([Pore_0_2, geomObj_82], True) -geomObj_84 = geompy.MakeVertex(3, 1, 0) -geomObj_85 = geompy.MakeVertex(3, 1, 1) -geomObj_86 = geompy.MakeVector(geomObj_84, geomObj_85) -geomObj_87 = geompy.MakeRotation(geomObj_82, geomObj_86, 45*math.pi/180.0) -geomObj_88 = geompy.MakeVertex(3, 1, 0) -geomObj_89 = geompy.MakeVertex(2, 0, 0) -geomObj_90 = geompy.MakeVector(geomObj_88, geomObj_89) -geomObj_91 = geompy.MakeTranslationVectorDistance(geomObj_87, geomObj_90, 1) -geomObj_92 = geompy.MakeTranslation(geomObj_91, -0.5, 0.5, 0) -geomObj_93 = geompy.MakeCommonList([geomObj_83, geomObj_92], True) -Fillet_1 = geompy.MakeFilletAll(Pore_0_1, 0.1) -Vertex_1 = geompy.MakeVertex(2, 2, 2) -Vertex_2 = geompy.MakeVertexWithRef(Vertex_1, 0, 0, 1) -Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2) -Plane_1 = geompy.MakePlane(Vertex_1, Vector_1, 5) -Common_1 = geompy.MakeCommonList([Pore_0_1, Plane_1], True) -[Face_3,Face_4,Face_5,Face_6] = geompy.ExtractShapes(Common_1, geompy.ShapeType["FACE"], True) -[Face_7,Face_8,geomObj_94,Face_2] = geompy.ExtractShapes(Common_1, geompy.ShapeType["FACE"], True) -[Face_1,Face_2,Face_3,Face_4] = geompy.ExtractShapes(Common_1, geompy.ShapeType["SHAPE"], True) -Translation_1 = geompy.MakeTranslation(Plane_1, 0, 0, -2) -Common_2 = geompy.MakeCommonList([Pore_0_1, Translation_1], True) -[Face_5,Face_6,Face_7,Face_8] = geompy.ExtractShapes(Common_2, geompy.ShapeType["SHAPE"], True) -geomObj_95 = geompy.GetInPlace(Pore_0_1, Common_1, True) -[geomObj_96,geomObj_97,geomObj_98,geomObj_99,geomObj_100,geomObj_101,geomObj_102,geomObj_103,geomObj_104,geomObj_105,geomObj_106,geomObj_107,geomObj_108,geomObj_109,geomObj_110,geomObj_111] = geompy.SubShapeAll(geomObj_95, geompy.ShapeType["VERTEX"]) -[geomObj_112,geomObj_113,geomObj_114,geomObj_115] = geompy.SubShapeAll(geomObj_95, geompy.ShapeType["FACE"]) -geomObj_116 = geompy.GetInPlace(Pore_0_1, Face_1, True) -[geomObj_117] = geompy.SubShapeAll(geomObj_116, geompy.ShapeType["FACE"]) -geomObj_118 = geompy.GetInPlace(Pore_0_1, Face_1, True) -[geomObj_119] = geompy.SubShapeAll(geomObj_118, geompy.ShapeType["FACE"]) -geomObj_120 = geompy.GetInPlace(Pore_0_1, Common_1, True) -[geomObj_121,geomObj_122,geomObj_123,geomObj_124] = geompy.SubShapeAll(geomObj_120, geompy.ShapeType["FACE"]) -[geomObj_125,geomObj_126,geomObj_127,geomObj_128] = geompy.SubShapeAll(geomObj_120, geompy.ShapeType["FACE"]) -Group_1 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_1, [28, 165, 72, 90]) -geomObj_129 = geompy.GetInPlace(Pore_0_1, Common_2, True) -[geomObj_130,geomObj_131,geomObj_132,geomObj_133,geomObj_134,geomObj_135,geomObj_136,geomObj_137,geomObj_138,geomObj_139,geomObj_140,geomObj_141,geomObj_142,geomObj_143,geomObj_144,geomObj_145] = geompy.SubShapeAll(geomObj_129, geompy.ShapeType["VERTEX"]) -[geomObj_146,geomObj_147,geomObj_148,geomObj_149] = geompy.SubShapeAll(geomObj_129, geompy.ShapeType["FACE"]) -[geomObj_150,geomObj_151,geomObj_152,geomObj_153] = geompy.SubShapeAll(geomObj_129, geompy.ShapeType["FACE"]) -Group_2 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_2, [102, 117, 51, 159]) -Group_3 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_3, [3, 17, 28, 33, 42, 51, 56, 63, 72, 77, 90, 95, 102, 107, 117, 120, 129, 136, 142, 149, 156, 159, 162, 165]) -Cut_1 = geompy.CutListOfGroups([Group_3], [Group_1, Group_2]) -geompy.addToStudy( Pore_0_1, 'Pore 0.1' ) -geompy.addToStudy( Pore_0_15, 'Pore 0.15' ) -geompy.addToStudy( Pore_0_2, 'Pore 0.2' ) -geompy.addToStudy( Fillet_1, 'Fillet_1' ) -geompy.addToStudy( Vertex_1, 'Vertex_1' ) -geompy.addToStudy( Vertex_2, 'Vertex_2' ) -geompy.addToStudy( Vector_1, 'Vector_1' ) -geompy.addToStudy( Plane_1, 'Plane_1' ) -geompy.addToStudy( Translation_1, 'Translation_1' ) -geompy.addToStudyInFather( Common_2, Face_8, 'Face_8' ) -geompy.addToStudyInFather( Common_2, Face_7, 'Face_7' ) -geompy.addToStudyInFather( Common_1, Face_2, 'Face_2' ) -geompy.addToStudy( Common_2, 'Common_2' ) -geompy.addToStudyInFather( Common_1, Face_1, 'Face_1' ) -geompy.addToStudy( Common_1, 'Common_1' ) -geompy.addToStudyInFather( Common_1, Face_3, 'Face_3' ) -geompy.addToStudyInFather( Common_1, Face_4, 'Face_4' ) -geompy.addToStudyInFather( Common_2, Face_5, 'Face_5' ) -geompy.addToStudyInFather( Common_2, Face_6, 'Face_6' ) -geompy.addToStudyInFather( Pore_0_1, Group_1, 'Group_1' ) -geompy.addToStudyInFather( Pore_0_1, Group_2, 'Group_2' ) -geompy.addToStudyInFather( Pore_0_1, Group_3, 'Group_3' ) -geompy.addToStudyInFather( Pore_0_1, Cut_1, 'Cut_1' ) - -### -### SMESH component -### - -import SMESH, SALOMEDS -from salome.smesh import smeshBuilder - -smesh = smeshBuilder.New() -#smesh.SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations: - # multiples meshes built in parallel, complex and numerous mesh edition (performance) - -Pore_0_1_1 = smesh.Mesh(Pore_0_1) -NETGEN_2D3D_1 = Pore_0_1_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -NETGEN_Parameters = NETGEN_2D3D_1.Parameters() -NETGEN_Parameters.SetSecondOrder( 0 ) -NETGEN_Parameters.SetOptimize( 1 ) -NETGEN_Parameters.SetChordalError( -1 ) -NETGEN_Parameters.SetChordalErrorEnabled( 0 ) -NETGEN_Parameters.SetUseSurfaceCurvature( 1 ) -NETGEN_Parameters.SetFuseEdges( 1 ) -NETGEN_Parameters.SetCheckChartBoundary( 0 ) -NETGEN_Parameters.SetMinSize( 0.01 ) -NETGEN_Parameters.SetMaxSize( 0.05 ) -NETGEN_Parameters.SetFineness( 5 ) -NETGEN_Parameters.SetGrowthRate( 0.1 ) -NETGEN_Parameters.SetNbSegPerEdge( 5 ) -NETGEN_Parameters.SetNbSegPerRadius( 10 ) -NETGEN_Parameters.SetQuadAllowed( 1 ) -isDone = Pore_0_1_1.Compute() -Pore_0_15_1 = smesh.Mesh(Pore_0_15) -NETGEN_2D3D_1_1 = Pore_0_15_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -NETGEN_Parameters_1 = NETGEN_2D3D_1_1.Parameters() -NETGEN_Parameters_1.SetSecondOrder( 0 ) -NETGEN_Parameters_1.SetOptimize( 1 ) -NETGEN_Parameters_1.SetChordalError( -1 ) -NETGEN_Parameters_1.SetChordalErrorEnabled( 0 ) -NETGEN_Parameters_1.SetUseSurfaceCurvature( 1 ) -NETGEN_Parameters_1.SetFuseEdges( 1 ) -NETGEN_Parameters_1.SetCheckChartBoundary( 0 ) -NETGEN_Parameters_1.SetMinSize( 0.01 ) -NETGEN_Parameters_1.SetMaxSize( 0.05 ) -NETGEN_Parameters_1.SetFineness( 5 ) -NETGEN_Parameters_1.SetGrowthRate( 0.1 ) -NETGEN_Parameters_1.SetNbSegPerEdge( 5 ) -NETGEN_Parameters_1.SetNbSegPerRadius( 10 ) -NETGEN_Parameters_1.SetQuadAllowed( 1 ) -isDone = Pore_0_15_1.Compute() -Pore_0_2_1 = smesh.Mesh(Pore_0_2) -NETGEN_2D3D_1_2 = Pore_0_2_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -NETGEN_Parameters_2 = NETGEN_2D3D_1_2.Parameters() -NETGEN_Parameters_2.SetSecondOrder( 0 ) -NETGEN_Parameters_2.SetOptimize( 1 ) -NETGEN_Parameters_2.SetChordalError( -1 ) -NETGEN_Parameters_2.SetChordalErrorEnabled( 0 ) -NETGEN_Parameters_2.SetUseSurfaceCurvature( 1 ) -NETGEN_Parameters_2.SetFuseEdges( 1 ) -NETGEN_Parameters_2.SetCheckChartBoundary( 0 ) -NETGEN_Parameters_2.SetMinSize( 0.01 ) -NETGEN_Parameters_2.SetMaxSize( 0.05 ) -NETGEN_Parameters_2.SetFineness( 5 ) -NETGEN_Parameters_2.SetGrowthRate( 0.1 ) -NETGEN_Parameters_2.SetNbSegPerEdge( 5 ) -NETGEN_Parameters_2.SetNbSegPerRadius( 10 ) -NETGEN_Parameters_2.SetQuadAllowed( 1 ) -isDone = Pore_0_2_1.Compute() -Mesh_1 = smesh.Mesh(Fillet_1) -status = Mesh_1.AddHypothesis(NETGEN_Parameters_2) -NETGEN_2D3D_1_3 = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -Viscous_Layers_1 = NETGEN_2D3D_1_3.ViscousLayers(0.05,1,1,None,None,smeshBuilder.SURF_OFFSET_SMOOTH) -NETGEN_Parameters_2.SetMaxSize( 0.1 ) -NETGEN_Parameters_2.SetFineness( 3 ) -NETGEN_Parameters_2.SetQuadAllowed( 0 ) -Viscous_Layers_1.SetTotalThickness( 0.01 ) -Viscous_Layers_1.SetNumberLayers( 1 ) -Viscous_Layers_1.SetStretchFactor( 1 ) -Viscous_Layers_1.SetMethod( smeshBuilder.FACE_OFFSET ) -Viscous_Layers_1.SetFaces( [], 1 ) -isDone = Mesh_1.Compute() -Mesh_2 = smesh.Mesh(Pore_0_1) -status = Mesh_2.AddHypothesis(NETGEN_Parameters_2) -status = Mesh_2.AddHypothesis(Viscous_Layers_1) -NETGEN_2D3D_1_4 = Mesh_2.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -Viscous_Layers_1.SetTotalThickness( 0.025 ) -Viscous_Layers_1.SetNumberLayers( 5 ) -Viscous_Layers_1.SetStretchFactor( 1.1 ) -Viscous_Layers_1.SetMethod( smeshBuilder.NODE_OFFSET ) -Viscous_Layers_1.SetFaces( [], 1 ) -isDone = Mesh_2.Compute() -Group_1_1 = Mesh_2.GroupOnGeom(Group_1,'Group_1',SMESH.FACE) -[ Group_1_1 ] = Mesh_2.GetGroups() -Group_2_1 = Mesh_2.GroupOnGeom(Group_2,'Group_2',SMESH.FACE) -[ Group_1_1, Group_2_1 ] = Mesh_2.GetGroups() -Group_3_1 = Mesh_2.GroupOnGeom(Cut_1,'Group_3',SMESH.FACE) -[ Group_1_1, Group_2_1, Group_3_1 ] = Mesh_2.GetGroups() - - -## Set names of Mesh objects -smesh.SetName(NETGEN_2D3D_1.GetAlgorithm(), 'NETGEN_2D3D_1') -smesh.SetName(NETGEN_Parameters_1, 'NETGEN_Parameters') -smesh.SetName(NETGEN_Parameters_2, 'NETGEN_Parameters') -smesh.SetName(NETGEN_Parameters, 'NETGEN_Parameters') -smesh.SetName(Viscous_Layers_1, 'Viscous Layers_1') -smesh.SetName(Pore_0_1_1.GetMesh(), 'Pore 0.1') -smesh.SetName(Pore_0_2_1.GetMesh(), 'Pore 0.2') -smesh.SetName(Pore_0_15_1.GetMesh(), 'Pore 0.15') -smesh.SetName(Mesh_2.GetMesh(), 'Mesh_2') -smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1') -smesh.SetName(Group_1_1, 'Group_1') -smesh.SetName(Group_2_1, 'Group_2') -smesh.SetName(Group_3_1, 'Group_3') - - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser() diff --git a/worksheet/cube_260221.hdf b/worksheet/cube_260221.hdf deleted file mode 100644 index 6b071d9..0000000 Binary files a/worksheet/cube_260221.hdf and /dev/null differ diff --git a/worksheet/runrun.py b/worksheet/runrun.py deleted file mode 100644 index b9101f5..0000000 --- a/worksheet/runrun.py +++ /dev/null @@ -1,2 +0,0 @@ -import os; os.chdir(os.path.join(os.getcwd(), "projects/anisotrope-cube/src/simple-cubic")) -exec(open("main.py", "rb").read(), args=("asd", 0.1)) diff --git a/worksheet/test.py b/worksheet/test.py deleted file mode 100644 index 7d9eb3c..0000000 --- a/worksheet/test.py +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env python - -### -### This file is generated automatically by SALOME v9.6.0 with dump python functionality -### - -import sys -import salome - -salome.salome_init() -import salome_notebook -notebook = salome_notebook.NoteBook() -sys.path.insert(0, r'/home/nafaryus/projects/anisotrope-cube/worksheet') - -### -### GEOM component -### - -import GEOM -from salome.geom import geomBuilder -import math -import SALOMEDS - - -geompy = geomBuilder.New() - -geomObj_1 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_2 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_3 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_4 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_5 = geompy.MakeRotation(geomObj_4, geomObj_3, 45*math.pi/180.0) -geomObj_6 = geompy.MakeTranslation(geomObj_5, 2, 0, 0) -geomObj_7 = geompy.MakeVertex(2, 0, 0) -geomObj_8 = geompy.MakeVertex(2, 2, 0) -geomObj_9 = geompy.MakeVertex(2, 2, 2) -geomObj_10 = geompy.MakeLineTwoPnt(geomObj_8, geomObj_9) -geomObj_11 = geompy.MakeSpherePntR(geomObj_7, 1.111111111111111) -geomObj_12 = geompy.MakeMultiTranslation1D(geomObj_11, geomObj_2, 2, 3) -geomObj_13 = geompy.MakeCutList(geomObj_6, [geomObj_12], True) -geomObj_14 = geompy.MakeTranslation(geomObj_12, 0, 0, 2) -geomObj_15 = geompy.MakeCutList(geomObj_13, [geomObj_14], True) -geomObj_16 = geompy.MakeRotation(geomObj_12, geomObj_10, 90*math.pi/180.0) -geomObj_17 = geompy.MakeCutList(geomObj_15, [geomObj_16], True) -geomObj_18 = geompy.MakeTranslation(geomObj_16, 0, 0, 2) -Pore_0_1 = geompy.MakeCutList(geomObj_17, [geomObj_18], True) -geomObj_19 = geompy.MakeBoxDXDYDZ(2, 2, 2) -geomObj_20 = geompy.MakeTranslation(geomObj_19, 2, 0, 0) -geomObj_21 = geompy.MakeCommonList([Pore_0_1, geomObj_20], True) -geomObj_22 = geompy.MakeVertex(3, 1, 0) -geomObj_23 = geompy.MakeVertex(3, 1, 1) -geomObj_24 = geompy.MakeVector(geomObj_22, geomObj_23) -geomObj_25 = geompy.MakeRotation(geomObj_20, geomObj_24, 45*math.pi/180.0) -geomObj_26 = geompy.MakeVertex(3, 1, 0) -geomObj_27 = geompy.MakeVertex(2, 0, 0) -geomObj_28 = geompy.MakeVector(geomObj_26, geomObj_27) -geomObj_29 = geompy.MakeTranslationVectorDistance(geomObj_25, geomObj_28, 1) -geomObj_30 = geompy.MakeTranslation(geomObj_29, -0.5, 0.5, 0) -geomObj_31 = geompy.MakeCommonList([geomObj_21, geomObj_30], True) -geomObj_32 = geompy.MakeVertex(2, 2, 2) -geomObj_33 = geompy.MakeVertexWithRef(geomObj_32, 0, 0, 1) -geomObj_34 = geompy.MakeVector(geomObj_32, geomObj_33) -geomObj_35 = geompy.MakePlane(geomObj_32, geomObj_34, 5) -geomObj_36 = geompy.MakeCommonList([Pore_0_1, geomObj_35], True) -geomObj_37 = geompy.MakeTranslation(geomObj_35, 0, 0, -2) -geomObj_38 = geompy.MakeCommonList([Pore_0_1, geomObj_37], True) -geomObj_39 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_39, [2, 12, 22, 32]) -geomObj_40 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_40, [2, 12, 22, 32]) -geomObj_41 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_41, [3, 17, 28, 33, 42, 51, 56, 63, 72, 77, 90, 95, 102, 107, 117, 120, 129, 136, 142, 149, 156, 159, 162, 165]) -geomObj_42 = geompy.CutListOfGroups([geomObj_41], [geomObj_39, geomObj_40]) -geomObj_43 = geompy.MakeVectorDXDYDZ(1, 0, 0) -geomObj_44 = geompy.MakeVectorDXDYDZ(0, 1, 0) -geomObj_45 = geompy.MakeVectorDXDYDZ(0, 0, 1) -geomObj_46 = geompy.MakeBoxDXDYDZ(2.82842712474619, 2.82842712474619, 2) -geomObj_47 = geompy.MakeRotation(geomObj_46, geomObj_45, 45*math.pi/180.0) -geomObj_48 = geompy.MakeTranslation(geomObj_47, 2, 0, 0) -geomObj_49 = geompy.MakeVertex(2, 0, 0) -geomObj_50 = geompy.MakeVertex(2, 2, 0) -geomObj_51 = geompy.MakeVertex(2, 2, 2) -geomObj_52 = geompy.MakeLineTwoPnt(geomObj_50, geomObj_51) -geomObj_53 = geompy.MakeSpherePntR(geomObj_49, 1.111111111111111) -geomObj_54 = geompy.MakeMultiTranslation1D(geomObj_53, geomObj_44, 2, 3) -geomObj_55 = geompy.MakeCutList(geomObj_48, [geomObj_54], True) -geomObj_56 = geompy.MakeTranslation(geomObj_54, 0, 0, 2) -geomObj_57 = geompy.MakeCutList(geomObj_55, [geomObj_56], True) -geomObj_58 = geompy.MakeRotation(geomObj_54, geomObj_52, 90*math.pi/180.0) -geomObj_59 = geompy.MakeCutList(geomObj_57, [geomObj_58], True) -geomObj_60 = geompy.MakeTranslation(geomObj_58, 0, 0, 2) -geomObj_61 = geompy.MakeCutList(geomObj_59, [geomObj_60], True) -geomObj_62 = geompy.MakeBoxDXDYDZ(2, 2, 2) -geomObj_63 = geompy.MakeTranslation(geomObj_62, 2, 0, 0) -geomObj_64 = geompy.MakeCommonList([geomObj_61, geomObj_63], True) -geomObj_65 = geompy.MakeVertex(3, 1, 0) -geomObj_66 = geompy.MakeVertex(3, 1, 1) -geomObj_67 = geompy.MakeVector(geomObj_65, geomObj_66) -geomObj_68 = geompy.MakeRotation(geomObj_63, geomObj_67, 45*math.pi/180.0) -geomObj_69 = geompy.MakeVertex(3, 1, 0) -geomObj_70 = geompy.MakeVertex(2, 0, 0) -geomObj_71 = geompy.MakeVector(geomObj_69, geomObj_70) -geomObj_72 = geompy.MakeTranslationVectorDistance(geomObj_68, geomObj_71, 1) -geomObj_73 = geompy.MakeTranslation(geomObj_72, -0.5, 0.5, 0) -geomObj_74 = geompy.MakeCommonList([geomObj_64, geomObj_73], True) -geomObj_75 = geompy.MakeVertex(2, 2, 2) -geomObj_76 = geompy.MakeVertexWithRef(geomObj_75, 0, 0, 1) -geomObj_77 = geompy.MakeVector(geomObj_75, geomObj_76) -geomObj_78 = geompy.MakePlane(geomObj_75, geomObj_77, 5) -geomObj_79 = geompy.MakeCommonList([geomObj_61, geomObj_78], True) -geomObj_80 = geompy.MakeTranslation(geomObj_78, 0, 0, -2) -geomObj_81 = geompy.MakeCommonList([geomObj_61, geomObj_80], True) -geomObj_82 = geompy.CreateGroup(geomObj_61, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_82, [2, 12, 22, 32]) -geomObj_83 = geompy.CreateGroup(geomObj_61, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_83, [2, 12, 22, 32]) -geomObj_84 = geompy.CreateGroup(geomObj_61, geompy.ShapeType["FACE"]) -geompy.UnionIDs(geomObj_84, [3, 17, 28, 33, 42, 51, 56, 63, 72, 77, 90, 95, 102, 107, 117, 120, 129, 136, 142, 149, 156, 159, 162, 165]) -geomObj_85 = geompy.CutListOfGroups([geomObj_84], [geomObj_82, geomObj_83]) -Vertex_1 = geompy.MakeVertex(2, 2, 2) -Vertex_2 = geompy.MakeVertexWithRef(Vertex_1, 0, 0, 1) -Vector_1 = geompy.MakeVector(Vertex_1, Vertex_2) -Plane_1 = geompy.MakePlane(Vertex_1, Vector_1, 5) -[geomObj_86] = geompy.SubShapeAll(Plane_1, geompy.ShapeType["FACE"]) -[geomObj_87] = geompy.SubShapeAll(Plane_1, geompy.ShapeType["FACE"]) -Common_1 = geompy.MakeCommonList([Pore_0_1, Plane_1], True) -[geomObj_88,geomObj_89,geomObj_90,geomObj_91,geomObj_92,geomObj_93,geomObj_94,geomObj_95,geomObj_96,geomObj_97,geomObj_98,geomObj_99,geomObj_100,geomObj_101,geomObj_102,geomObj_103] = geompy.SubShapeAll(Common_1, geompy.ShapeType["VERTEX"]) -[geomObj_104,geomObj_105,geomObj_106,geomObj_107] = geompy.SubShapeAll(Common_1, geompy.ShapeType["FACE"]) -[geomObj_108,geomObj_109,geomObj_110,geomObj_111] = geompy.SubShapeAll(Common_1, geompy.ShapeType["FACE"]) -[geomObj_112,geomObj_113,geomObj_114,geomObj_115] = geompy.SubShapeAll(Common_1, geompy.ShapeType["FACE"]) -[geomObj_116,geomObj_117,geomObj_118,geomObj_119] = geompy.SubShapeAll(Common_1, geompy.ShapeType["FACE"]) -[geomObj_120,geomObj_121,geomObj_122,geomObj_123] = geompy.SubShapeAll(Common_1, geompy.ShapeType["FACE"]) -geomObj_124 = geompy.GetInPlace(Common_1, Plane_1, True) -[geomObj_125,geomObj_126,geomObj_127,geomObj_128] = geompy.SubShapeAll(geomObj_124, geompy.ShapeType["FACE"]) -geomObj_129 = geompy.GetInPlace(Pore_0_1, Common_1, True) -[geomObj_130,geomObj_131,geomObj_132,geomObj_133] = geompy.SubShapeAll(geomObj_129, geompy.ShapeType["FACE"]) -geomObj_134 = geompy.GetInPlace(Pore_0_1, Common_1, True) -[geomObj_135,geomObj_136,geomObj_137,geomObj_138] = geompy.SubShapeAll(geomObj_134, geompy.ShapeType["FACE"]) -Group_1 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_1, [28, 165, 72, 90]) -geomObj_139 = geompy.GetInPlace(Pore_0_1, Common_1, True) -[geomObj_140,geomObj_141,geomObj_142,geomObj_143] = geompy.SubShapeAll(geomObj_139, geompy.ShapeType["FACE"]) -[geomObj_144,geomObj_145,geomObj_146,geomObj_147] = geompy.SubShapeAll(geomObj_139, geompy.ShapeType["FACE"]) -Group_2 = geompy.CreateGroup(Pore_0_1, geompy.ShapeType["FACE"]) -geompy.UnionIDs(Group_2, [28, 165, 72, 90]) -geompy.addToStudy( Pore_0_1, 'Pore 0.1' ) -geompy.addToStudy( Vertex_1, 'Vertex_1' ) -geompy.addToStudy( Vertex_2, 'Vertex_2' ) -geompy.addToStudy( Vector_1, 'Vector_1' ) -geompy.addToStudy( Plane_1, 'Plane_1' ) -geompy.addToStudy( Common_1, 'Common_1' ) -geompy.addToStudyInFather( Pore_0_1, Group_1, 'Group_1' ) -geompy.addToStudyInFather( Pore_0_1, Group_2, 'Group_2' ) - -### -### SMESH component -### - -import SMESH, SALOMEDS -from salome.smesh import smeshBuilder - -smesh = smeshBuilder.New() -#smesh.SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations: - # multiples meshes built in parallel, complex and numerous mesh edition (performance) - -mesh_unv = smesh.CreateMeshesFromUNV(r'/home/nafaryus/projects/anisotrope-cube/build/simple-cubic/0.1/mesh.unv') -wall = mesh_unv.GetGroups()[ 0 ] -[ wall ] = mesh_unv.GetGroups() -mesh_unv_1 = smesh.CreateMeshesFromUNV(r'/home/nafaryus/projects/anisotrope-cube/build/simple-cubic/0.15/mesh.unv') -wall_1 = mesh_unv_1.GetGroups()[ 0 ] -[ wall_1 ] = mesh_unv_1.GetGroups() -mesh_unv_2 = smesh.CreateMeshesFromUNV(r'/home/nafaryus/projects/anisotrope-cube/build/simple-cubic/0.2/mesh.unv') -wall_2 = mesh_unv_2.GetGroups()[ 0 ] -[ wall_2 ] = mesh_unv_2.GetGroups() -Pore_0_1_1 = smesh.Mesh(Pore_0_1) -NETGEN_2D3D_1 = Pore_0_1_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D) -NETGEN_Parameters = NETGEN_2D3D_1.Parameters() -NETGEN_Parameters.SetSecondOrder( 0 ) -NETGEN_Parameters.SetOptimize( 1 ) -NETGEN_Parameters.SetChordalError( -1 ) -NETGEN_Parameters.SetChordalErrorEnabled( 0 ) -NETGEN_Parameters.SetUseSurfaceCurvature( 1 ) -NETGEN_Parameters.SetFuseEdges( 1 ) -NETGEN_Parameters.SetCheckChartBoundary( 0 ) -NETGEN_Parameters.SetMinSize( 0.01 ) -NETGEN_Parameters.SetMaxSize( 0.1 ) -NETGEN_Parameters.SetFineness( 3 ) -NETGEN_Parameters.SetQuadAllowed( 0 ) -ViscousLayers_0_025 = NETGEN_2D3D_1.ViscousLayers(0.025,5,1.1,[],1,smeshBuilder.NODE_OFFSET) -inlet = Pore_0_1_1.GroupOnGeom(__NOT__Published__Object__,'inlet',SMESH.FACE) -outlet = Pore_0_1_1.GroupOnGeom(__NOT__Published__Object__,'outlet',SMESH.FACE) -wall_3 = Pore_0_1_1.GroupOnGeom(__NOT__Published__Object__,'wall',SMESH.FACE) -isDone = Pore_0_1_1.Compute() -try: - Pore_0_1_1.ExportUNV( r'asd/mesh.unv' ) - pass -except: - print('ExportUNV() failed. Invalid file name?') -NETGEN_Parameters_1 = smesh.CreateHypothesis('NETGEN_Parameters', 'libNETGENEngine.so') -NETGEN_Parameters_1.SetSecondOrder( 0 ) -NETGEN_Parameters_1.SetOptimize( 1 ) -NETGEN_Parameters_1.SetChordalError( -1 ) -NETGEN_Parameters_1.SetChordalErrorEnabled( 0 ) -NETGEN_Parameters_1.SetUseSurfaceCurvature( 1 ) -NETGEN_Parameters_1.SetFuseEdges( 1 ) -NETGEN_Parameters_1.SetCheckChartBoundary( 0 ) -NETGEN_Parameters_1.SetMinSize( 0.01 ) -NETGEN_Parameters_1.SetMaxSize( 0.1 ) -NETGEN_Parameters_1.SetFineness( 3 ) -NETGEN_Parameters_1.SetQuadAllowed( 0 ) -ViscousLayers_0_025_1 = smesh.CreateHypothesis('ViscousLayers') -ViscousLayers_0_025_1.SetTotalThickness( 0.025 ) -ViscousLayers_0_025_1.SetNumberLayers( 5 ) -ViscousLayers_0_025_1.SetStretchFactor( 1.1 ) -ViscousLayers_0_025_1.SetFaces( [], 1 ) -ViscousLayers_0_025_1.SetMethod( smeshBuilder.NODE_OFFSET ) -try: - pass -except: - print('ExportUNV() failed. Invalid file name?') - - -## Set names of Mesh objects -smesh.SetName(wall, 'wall') -smesh.SetName(NETGEN_Parameters, 'NETGEN_Parameters') -smesh.SetName(NETGEN_Parameters_1, 'NETGEN_Parameters') -smesh.SetName(ViscousLayers_0_025, 'ViscousLayers=0.025,5,1.1,[],1') -smesh.SetName(ViscousLayers_0_025_1, 'ViscousLayers=0.025,5,1.1,[],1') -smesh.SetName(NETGEN_2D3D_1.GetAlgorithm(), 'NETGEN_2D3D_1') -smesh.SetName(mesh_unv.GetMesh(), 'mesh.unv') -smesh.SetName(Pore_0_1_1.GetMesh(), 'Pore 0.1') -smesh.SetName(mesh_unv_1.GetMesh(), 'mesh.unv') -smesh.SetName(mesh_unv_2.GetMesh(), 'mesh.unv') -smesh.SetName(wall_1, 'wall') -smesh.SetName(outlet, 'outlet') -smesh.SetName(wall_3, 'wall') -smesh.SetName(wall_2, 'wall') -smesh.SetName(inlet, 'inlet') - - -if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser()