Example #1
0
def generate_gmsh(receiver,
                  source,
                  dimensions,
                  order=None,
                  other_options=[],
                  extension="geo",
                  gmsh_executable="gmsh",
                  force_dimension=None):
    from meshpy.gmsh import GmshRunner
    runner = GmshRunner(source,
                        dimensions,
                        order=order,
                        other_options=other_options,
                        extension=extension,
                        gmsh_executable=gmsh_executable)

    runner.__enter__()
    try:
        result = parse_gmsh(receiver,
                            runner.output_file,
                            force_dimension=force_dimension)
    finally:
        runner.__exit__(None, None, None)

    return result
Example #2
0
def generate_gmsh(receiver,
                  source,
                  dimensions,
                  order=None,
                  other_options=[],
                  extension="geo",
                  gmsh_executable="gmsh",
                  force_dimension=None):
    """Run gmsh and feed the output to *receiver*.

    :arg source: an instance of :class:`LiteralSource` or :class:`FileSource`
    :param receiver: Implements the :class:`GmshMeshReceiverBase` interface.
    """
    from meshpy.gmsh import GmshRunner
    runner = GmshRunner(source,
                        dimensions,
                        order=order,
                        other_options=other_options,
                        extension=extension,
                        gmsh_executable=gmsh_executable)

    runner.__enter__()
    try:
        result = parse_gmsh(receiver,
                            runner.output_file,
                            force_dimension=force_dimension)
    finally:
        runner.__exit__(None, None, None)

    return result
Example #3
0
def generate_gmsh(receiver, source, dimensions, order=None, other_options=[],
            extension="geo", gmsh_executable="gmsh", force_dimension=None):
    from meshpy.gmsh import GmshRunner
    runner = GmshRunner(source, dimensions, order=order,
            other_options=other_options, extension=extension,
            gmsh_executable=gmsh_executable)

    runner.__enter__()
    try:
        result = parse_gmsh(receiver, runner.output_file)
    finally:
        runner.__exit__(None, None, None)

    return result
Example #4
0
def generate_gmsh(receiver, source, dimensions, order=None, other_options=[],
            extension="geo", gmsh_executable="gmsh", force_dimension=None):
    """Run gmsh and feed the output to *receiver*.

    :arg source: an instance of :class:`LiteralSource` or :class:`FileSource`
    :param receiver: Implements the :class:`GmshMeshReceiverBase` interface.
    """
    from meshpy.gmsh import GmshRunner
    runner = GmshRunner(source, dimensions, order=order,
            other_options=other_options, extension=extension,
            gmsh_executable=gmsh_executable)

    runner.__enter__()
    try:
        result = parse_gmsh(receiver, runner.output_file,
                force_dimension=force_dimension)
    finally:
        runner.__exit__(None, None, None)

    return result
Example #5
0
def generate_gmsh(source, dimensions, order=None, other_options=[],
            extension="geo", gmsh_executable="gmsh",
            force_dimension=None, periodicity=None,
            allow_internal_boundaries=False,
            tag_mapper=lambda tag: tag):
    from meshpy.gmsh import GmshRunner
    runner = GmshRunner(source, dimensions, order=order, 
            other_options=other_options, extension=extension, 
            gmsh_executable=gmsh_executable)

    runner.__enter__()
    try:
        result = parse_gmsh(runner.output_file,
                force_dimension=force_dimension, 
                periodicity=periodicity, 
                allow_internal_boundaries=allow_internal_boundaries,
                tag_mapper=tag_mapper)
    finally:
        runner.__exit__(None, None, None)

    return result