Skip to content
Snippets Groups Projects
Select Git revision
  • d2918e1b65453104130bcba769c2356e187fa148
  • master default protected
  • overlaps_tags_and_distributed_export
  • relaying
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

plot2d.geo

Blame
  • waveguide2d.geo 1.91 KiB
    Include "waveguide2d_data.geo";
    
    Solver.AutoMesh = -1; // the geometry script generates the mesh
    
    If(MPI_Size == 1) // sequential meshing
      start = 0;
      end = N_DOM-1;
    EndIf
    If(MPI_Size > 1) // parallel meshing
      start = MPI_Rank;
      end = MPI_Rank;
    EndIf
    
    For idom In {start:end}
    
      //NewModel;
      Delete Model;
    
      Point(1) = {idom*dDom, 0, 0., LC};
      myExtrudedLine[] = Extrude {0, DY, 0} {
        Point{1}; Layers{DY/LC};
      };
      myExtrudedSurface[] = Extrude {dDom, 0, 0} {
        Line{myExtrudedLine[1]}; Layers{dDom/LC}; Recombine;
      };
      lateralSides[] = {};
      For i In {2:3}
        lateralSides += myExtrudedSurface[i];
      EndFor
      pmlLeft[] = Extrude {-dBb, 0, 0} {
        Line{myExtrudedLine[1]}; Layers{dBb/LC}; Recombine;
      };
      pmlRight[] = Extrude {dBb, 0, 0} {
        Line{myExtrudedSurface[0]}; Layers{dBb/LC}; Recombine;
      };
    
      pmlLeftSides[] = {};
      For i In {2:3}
        pmlLeftSides += pmlLeft[i];
      EndFor
    
      pmlRightSides[] = {};
      For i In {2:3}
        pmlRightSides += pmlRight[i];
      EndFor
    
      Physical Line(-((idom+1)*1000+10)) = myExtrudedLine[1]; // left face
      Physical Line(((idom+1)*1000+20)) = myExtrudedSurface[0]; // right face
      Physical Line(-((idom+1)*1000+202)) = lateralSides[]; // lateral shell
      Physical Surface(((idom+1)*1000+200)) = myExtrudedSurface[1];
    
      Physical Line(-((idom+1)*1000+1)) = pmlLeft[0]; // left face
      Physical Line(((idom+1)*1000+102)) = pmlLeftSides[]; // lateral shell
      Physical Surface(((idom+1)*1000+100)) = pmlLeft[1];
    
      Physical Line(((idom+1)*1000+4)) = pmlRight[0]; // right face
      Physical Line(-((idom+1)*1000+302)) = pmlRightSides[]; // lateral shell
      Physical Surface(((idom+1)*1000+300)) = pmlRight[1];
    
      If(StrCmp(OnelabAction, "check")) // only mesh if not in onelab check mode
        Printf("Meshing waveguide subdomain %g...", idom);
        Mesh 2;
        CreateDir Str(DIR);
        Save StrCat(MSH_NAME, Sprintf("%g.msh", idom));
        Printf("Done.");
      EndIf
    
    EndFor
    
    BoundingBox {0, DX, 0, DY, 0, DZ};