Exemple #1
0
def WriteFluidMat(name, density, viscosity, gravity, projectname):
    newsection = FluidMat(name, density, viscosity, gravity)
    key = 'BOOK: Fluid_Material\n'
    file = projectname + '.mat'
    filecontent = basicfunctions.splitfile(key, basicfunctions.readfile(file))
    newcontent = filecontent[0] + key + newsection + filecontent[1]
    basicfunctions.writefile(file, newcontent)
Exemple #2
0
def WriteFluidMat(name, density, viscosity, gravity, projectname):
    newsection = FluidMat(name, density, viscosity, gravity)
    key = 'BOOK: Fluid_Material\n'
    file = projectname + '.mat'
    filecontent = basicfunctions.splitfile(key, basicfunctions.readfile(file))
    newcontent = filecontent[0] + key + newsection + filecontent[1]
    basicfunctions.writefile(file, newcontent)
Exemple #3
0
def WriteStructureMat(name, density, young_module, poisson_ratio, thickness, cross_section_area, projectname):
    newsection = StructureMat(name, density, young_module, poisson_ratio, thickness, cross_section_area, projectname)
    key = 'BOOK: Structure_Material\n'
    file = projectname + '.mat'
    filecontent = basicfunctions.splitfile(key, basicfunctions.readfile(file))
    newcontent = filecontent[0] + key + newsection + filecontent[1]
    basicfunctions.writefile(file, newcontent)
Exemple #4
0
def AddElemToCndFile(newsection, projectname, domaintype):
    if domaintype == 'Fluid':
        key = 'BOOK: Fluid_Element_Type\n'
    if domaintype == 'Structure':
        key = 'BOOK: Structure_Element_Type\n'
    file = projectname + '.cnd'
    filecontent = basicfunctions.splitfile(key, basicfunctions.readfile(file))
    newcontent = filecontent[0] + key + newsection + filecontent[1]
    basicfunctions.writefile(file, newcontent)
Exemple #5
0
def AddBCToCndFile(newsection, projectname, domaintype):
    if domaintype == 'Fluid':
        key = 'BOOK: Fluid_Boundary_Conditions\n'
    if domaintype == 'Structure':
        key = 'BOOK: Structure_Boundary_Conditions\n'
    file = projectname + '.cnd'
    filecontent = basicfunctions.splitfile(key, basicfunctions.readfile(file))
    newcontent = filecontent[0] + key + newsection + filecontent[1]
    basicfunctions.writefile(file, newcontent)
Exemple #6
0
def WriteStructureMat(name, density, young_module, poisson_ratio, thickness,
                      cross_section_area, projectname):
    newsection = StructureMat(name, density, young_module, poisson_ratio,
                              thickness, cross_section_area, projectname)
    key = 'BOOK: Structure_Material\n'
    file = projectname + '.mat'
    filecontent = basicfunctions.splitfile(key, basicfunctions.readfile(file))
    newcontent = filecontent[0] + key + newsection + filecontent[1]
    basicfunctions.writefile(file, newcontent)
Exemple #7
0
def ImportFiles(projectname, projectpath, mode, archivpath):
    quelle = archivpath + 'coupling.prb'
    ziel = projectpath + projectname + '.gid' + '/' + projectname + '.prb'
    basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    quelle = archivpath + 'coupling.bas'
    ziel = projectpath + projectname + '.gid' + '/' + projectname + '.bas'
    basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    if mode == 1:
        quelle = archivpath + '010_coupling.fluid.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/010_' + projectname + '.fluid.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '014_coupling.node.bas'
        ziel = projectpath + projectname + '.gid' + '/014_' + projectname + '.fluid.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'fluid.win.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname + '.win.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'fluid.unix.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname + '.unix.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    elif mode == 2:
        quelle = archivpath + '020_coupling.structure.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/020_' + projectname + '.structure.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '024_coupling.node.bas'
        ziel = projectpath + projectname + '.gid' + '/024_' + projectname + '.structure.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'structure.win.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname + '.win.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    elif mode == 3:
        quelle = archivpath + '010_coupling.fluid.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/010_' + projectname + '.fluid.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '014_coupling.fluid.node.bas'
        ziel = projectpath + projectname + '.gid' + '/014_' + projectname + '.fluid.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '020_coupling.structure.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/020_' + projectname + '.structure.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '024_coupling.structure.node.bas'
        ziel = projectpath + projectname + '.gid' + '/024_' + projectname + '.structure.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'fluidstructure.win.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname + '.win.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '030_coupling.coupling.bas'
        ziel = projectpath + projectname + '.gid' + '/030_' + projectname + '.coupling.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
Exemple #8
0
def ImportFiles(projectname, projectpath, mode, archivpath):
    quelle = archivpath + 'coupling.prb'
    ziel = projectpath + projectname + '.gid' + '/' + projectname+'.prb'
    basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    quelle = archivpath + 'coupling.bas'
    ziel = projectpath + projectname + '.gid' + '/' + projectname+'.bas'
    basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    if mode == 1:
        quelle = archivpath + '010_coupling.fluid.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/010_' + projectname+'.fluid.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '014_coupling.node.bas'
        ziel = projectpath + projectname + '.gid' + '/014_' + projectname+'.fluid.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'fluid.win.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname+'.win.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'fluid.unix.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname+'.unix.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    elif mode == 2:
        quelle = archivpath + '020_coupling.structure.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/020_' + projectname+'.structure.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '024_coupling.node.bas'
        ziel = projectpath + projectname + '.gid' + '/024_' + projectname+'.structure.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'structure.win.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname+'.win.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))
    elif mode == 3:
        quelle = archivpath + '010_coupling.fluid.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/010_' + projectname+'.fluid.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '014_coupling.fluid.node.bas'
        ziel = projectpath + projectname + '.gid' + '/014_' + projectname+'.fluid.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '020_coupling.structure.prop.bas'
        ziel = projectpath + projectname + '.gid' + '/020_' + projectname+'.structure.prop.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '024_coupling.structure.node.bas'
        ziel = projectpath + projectname + '.gid' + '/024_' + projectname+'.structure.node.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + 'fluidstructure.win.bat'
        ziel = projectpath + projectname + '.gid' + '/' + projectname+'.win.bat'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))

        quelle = archivpath + '030_coupling.coupling.bas'
        ziel = projectpath + projectname + '.gid' + '/030_' + projectname+'.coupling.bas'
        basicfunctions.writefile(ziel, basicfunctions.readfile(quelle))