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 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 #3
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 #4
0
def GenerateMatFile(filename, mode):
    if mode == 1:
        filecontent = 'BOOK: Fluid_Material\n'
    elif mode == 2:
        filecontent = 'BOOK: Structure_Material\n'
    elif mode == 3:
        filecontent = 'BOOK: Fluid_Material\n'
        filecontent = filecontent + 'BOOK: Structure_Material\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #5
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 #6
0
def GenerateMatFile(filename, mode):
    if mode == 1:
        filecontent = 'BOOK: Fluid_Material\n'
    elif mode == 2:
        filecontent = 'BOOK: Structure_Material\n'
    elif mode == 3:
        filecontent = 'BOOK: Fluid_Material\n'
        filecontent = filecontent + 'BOOK: Structure_Material\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #7
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 #8
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 #9
0
def GenerateCndFile(filename, mode):
    if mode == 1:
        filecontent = 'BOOK: Fluid_Boundary_Conditions\n'
        filecontent = filecontent + 'BOOK: Fluid_Element_Type\n'
    elif mode == 2:
        filecontent = 'BOOK: Structure_Boundary_Conditions\n'
        filecontent = filecontent + 'BOOK: Structure_Element_Type\n'
    elif mode == 3:
        con1 = 'BOOK: Fluid_Boundary_Conditions\n'
        con2 = 'BOOK: Fluid_Element_Type\n'
        con3 = 'BOOK: Fluid_Domain\n' + CndFluidDomainContent()
        con4 = 'BOOK: Structure_Boundary_Conditions\n'
        con5 = 'BOOK: Structure_Element_Type\n'
        con6 = 'BOOK: Structure_Domain\n' + CndStructureDomainContent()
        filecontent = con1 + con2 + con3 + con4 + con5+con6
    basicfunctions.writefile(filename, filecontent)
Exemple #10
0
def GenerateCndFile(filename, mode):
    if mode == 1:
        filecontent = 'BOOK: Fluid_Boundary_Conditions\n'
        filecontent = filecontent + 'BOOK: Fluid_Element_Type\n'
    elif mode == 2:
        filecontent = 'BOOK: Structure_Boundary_Conditions\n'
        filecontent = filecontent + 'BOOK: Structure_Element_Type\n'
    elif mode == 3:
        con1 = 'BOOK: Fluid_Boundary_Conditions\n'
        con2 = 'BOOK: Fluid_Element_Type\n'
        con3 = 'BOOK: Fluid_Domain\n' + CndFluidDomainContent()
        con4 = 'BOOK: Structure_Boundary_Conditions\n'
        con5 = 'BOOK: Structure_Element_Type\n'
        con6 = 'BOOK: Structure_Domain\n' + CndStructureDomainContent()
        filecontent = con1 + con2 + con3 + con4 + con5 + con6
    basicfunctions.writefile(filename, filecontent)
Exemple #11
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 #12
0
def GenerateStructureInitBas(filename):
    filecontent = '// Fixing degrees of freedom in nodes\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #13
0
def GenerateFluidCondBas(filename):
    filecontent = '\n\n// Fixing degrees of freedom in nodes\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #14
0
def GenerateStructureElemBas(filename):
    filecontent = '// Reading Elements\n\nElementsGroup = structural_group;\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #15
0
def GenerateFluidElemBas(filename):
    filecontent = '// Reading Elements\n\nElementsGroup = fluid_group;\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #16
0
def GenerateFluidElemBas(filename):
    filecontent = '// Reading Elements\n\nElementsGroup = fluid_group;\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #17
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 #18
0
def GenerateStructureInitBas(filename):
    filecontent = '// Fixing degrees of freedom in nodes\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #19
0
def GenerateFluidCondBas(filename):
    filecontent = '\n\n// Fixing degrees of freedom in nodes\n\n'
    basicfunctions.writefile(filename, filecontent)
Exemple #20
0
def GenerateStructureElemBas(filename):
    filecontent = '// Reading Elements\n\nElementsGroup = structural_group;\n\n'
    basicfunctions.writefile(filename, filecontent)