Esempio n. 1
0
 def test_Tet10_macro(self):
       file="tet10_gmsh.msh"
       ref="tet10_macro.fly"
       test = os.path.join(FINLEY_WORKDIR,"tet10_macro_test.fly")
       dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH,file),3,useMacroElements=True,optimize=False)
       dom.write(test)
       self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH,ref))
Esempio n. 2
0
 def test_Tet4(self):
       file="tet4_gmsh.msh"
       ref="tet4.fly"
       test = os.path.join(FINLEY_WORKDIR,"tet4_test.fly")
       dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH,file),3,optimize=False)
       dom.write(test)
       self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH,ref))
 def test_Tet10(self):
     file = "tet10_gmsh.msh"
     ref = "tet10.fly"
     test = os.path.join(FINLEY_WORKDIR, "tet10_test.fly")
     dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH, file),
                    3,
                    optimize=False)
     dom.write(test)
     self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH, ref))
 def test_Tri6_macro(self):
     file = "tri6_gmsh.msh"
     ref = "tri6_macro.fly"
     test = os.path.join(FINLEY_WORKDIR, "tri6_macro_test.fly")
     dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH, file),
                    2,
                    useMacroElements=True,
                    optimize=False)
     dom.write(test)
     self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH, ref))
Esempio n. 5
0
                else:
                    znew = float(z)
                fout.write("%s %g %g %g\n" % (i, float(x), float(y), znew))
                cc += 1
        else:
            fout.write(line)
        line = fin.readline()

    fin.close()
    fout.close()
    print("topography added to file %s and written to file %s." %
          (MSHN1, MSHN2))
    # now we are ready to generate the 3D mesh:
    rp = subprocess.run(
        ["gmsh", "-3", "-algo", "frontal", "-o", MSHN3, GEOFN2])
    rp.check_returncode()
    print(">> GMSH mesh file %s generated." % MSHN3)

if not args.flyno and not args.mshno:
    dts = []
    dps = []
    for s in elocations:
        if config.stationsFMT:
            dts.append(config.stationsFMT % s)
        else:
            dts.append(s)
        dps.append(elocations[s])
    domain = ReadGmsh(MSHN3, 3, diracPoints=dps, diracTags=dts, optimize=True)
    domain.write(config.meshfile)
    print("Mesh written to file %s" % (config.meshfile))