Exemplo n.º 1
0
def addToGfxSettings(gfxwindow):
    item = gfxwindow.menu.Settings.addItem(
        oofmenu.CheckOOFMenuItem(
            'Hide_Empty_Mesh_Elements',
            callback=toggleEmptyDrawing,
            value=gfxwindow.settings.hideEmptyElements,
            help="Toggle the display of elements with no Material.",
            discussion=xmlmenudump.loadFile(
                'DISCUSSIONS/common/menu/hideempty.xml')))
    item.data = gfxwindow
Exemplo n.º 2
0
registeredclass.Registration(
    "Other",
    InputSeparator,
    OtherSeparator,
    ordering=2,
    params=[
        parameter.StringParameter('character',
                                  ',',
                                  tip="The separator character(s).")
    ],
    tip="Any specified character or string of characters.")

#=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=#

## TODO: This should be obsolete, or at least not in this file.


def showTime():
    return settingsmenu.Show_Time.value


settingsmenu.addItem(
    oofmenu.CheckOOFMenuItem(
        'Show_Time',
        value=True,
        callback=_dummy,
        help="Show or hide the time column in output files.",
        discussion=xmlmenudump.loadFile(
            "DISCUSSIONS/common/menu/showtime.xml")))
Exemplo n.º 3
0
                discussion=xmlmenudump.loadFile(
                    'DISCUSSIONS/common/menu/sendlayer.xml')))

autoSendFlag = True


def setAutoSendCB(menuitem, value):
    global autoSendFlag
    autoSendFlag = value


settingsmenu.addItem(
    oofmenu.CheckOOFMenuItem(
        'AutoSend',
        value=autoSendFlag,
        callback=setAutoSendCB,
        help="Send layers to the graphics window as soon as they're edited.",
        discussion=xmlmenudump.loadFile(
            'DISCUSSIONS/common/menu/autosend.xml')))


class LayerEditor:
    def __init__(self):
        global menu
        self.menu = menu

        # The state of the editor is kept in a LayerSet, which is the
        # layer currently being edited.  Because it's possible to set
        # the WhoClass in the editor without specifying a Who, and
        # because a LayerSet only contains a Who, it's necessary to
        # keep a separate currentWhoClass variable.
Exemplo n.º 4
0
settingsmenu = formatchars.settingsmenu


def showTime():
    return settingsmenu.Show_Time.value


def _dummy(*args, **kwargs):
    pass


settingsmenu.addItem(
    oofmenu.CheckOOFMenuItem(
        'Show_Time',
        value=True,
        callback=_dummy,
        help="Show or hide the time column in output files."))

############################ MPI #########################################

## TODO 3.1: The MPI-enabled functions here have not been updated for
## doing time-dependent analysis.  They're commented out so that
## they're not mistaken for working code.

# if parallel_enable.enabled():
#     from ooflib.SWIG.common import mpitools
#     #Only frontend (rank 0) writes directly to destination
#     def _DirectOutput_call_frontend(output,domain,sampling,
#                                     destination):
#         otype = _ocheck(output)
Exemplo n.º 5
0
                               1000,
                               tip="Maximum number of iterations to perform.")
    ],
    tip="Conjugate Gradient method for iteratively solving symmetric matrices.",
    discussion=xmlmenudump.loadFile('DISCUSSIONS/engine/reg/cg.xml'))


def check_symmetry(menuitem, state):
    global _check_symmetry
    _check_symmetry = state


mainmenu.debugmenu.addItem(
    oofmenu.CheckOOFMenuItem(
        'Check_CG_symmetry',
        debug.debug(),
        callback=check_symmetry,
        help='Verify matrix symmetry before using Conjugate Gradient.',
        discussion="<para>For debugging.  Slow.</para>"))

#=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=##=--=#


class BiConjugateGradient(PreconditionedMatrixMethod):
    def __init__(self, preconditioner, tolerance, max_iterations):
        self.preconditioner = preconditioner
        self.tolerance = tolerance
        self.max_iterations = max_iterations

    def solveMatrix(self, matrix, rhs, solution):
        pc = self.preconditioner.create_preconditioner(matrix)
        return cmatrixmethods.solveBiCG(matrix, rhs, pc, self.max_iterations,
Exemplo n.º 6
0
    ))

autoDismiss = True
def _autodismiss(menuitem, value):
    global autoDismiss
    autoDismiss = value

settingsmenu.addItem(oofmenu.CheckOOFMenuItem(
    'AutoDismiss',
    value=autoDismiss,
    callback=_autodismiss,
    help="Dismiss progress bars automatically when processes end.",
    threadable = oofmenu.UNTHREADABLE,
    discussion="""<para>

    In GUI mode, when <command>AutoDismiss</command> is on, progress
    bars will be removed from the <link
    linkend='Section-Windows-ActivityViewer'>Activity Viewer</link>
    window when the task that they're monitoring finishes.  If
    <command>AutoDismiss</command> is off, it's necessary to remove
    progress bars explicitly with the <guibutton>Dismiss</guibutton> or
    <guibutton>Dismiss All</guibutton> buttons.

    </para>"""))

settingsmenu.addItem(oofmenu.OOFMenuItem(
    'DelayProgressBarCreation',
    callback=progressbar_delay.set_delay,
    params=[
    parameter.IntParameter('milliseconds', progressbar_delay.delay, tip="Delay time of the progress bar in milliseconds.")],
    help='Create progress bars only for processes that take longer than a specified time.',
Exemplo n.º 7
0
    oofmenu.OOFMenuItem(
        'Skeleton_Display',
        help="Options for what information to display on the skeleton page."))


#Returns true if user has checked the option to show weighted homogeneity index (default)
def showHomogIndex():
    return displaymenu.Show_Homogeneity_Index.value


#Creates menu item for weighted homogeneity index option
displaymenu.addItem(
    oofmenu.CheckOOFMenuItem(
        'Show_Homogeneity_Index',
        value=True,
        callback=skeletonpage.skel_update,
        help=
        'Show or hide the average homogeneity, weighted by element volume (recommended).'
    ))


#Returns true if user has checked the option to display unweighted homogeneity index
def showUnweightedHomogIndex():
    return displaymenu.Show_Unweighted_Homogeneity_Index.value


#Creates menu option for unweighted homogeneity index option
displaymenu.addItem(
    oofmenu.CheckOOFMenuItem(
        'Show_Unweighted_Homogeneity_Index',
        value=False,