wolfhece.mesh2d.bc_manager

Author: HECE - University of Liege, Pierre Archambeau Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

class wolfhece.mesh2d.bc_manager.BcManager(parent=None, linked_array: wolfhece.wolf_array.WolfArray = None, dx=1.0, dy=1.0, ox=0.0, oy=0.0, version=2, title=_('Boundary Condition manager'), width=500, height=500, DestroyAtClosing=False, Callback=None, mapviewer=None, wolfparent=None, *args, **kwargs)[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.mesh2d.bc_manager.BcManager

Boundary conditions Manager for WOLF

property linked_array[source]
property get_fname_cl[source]
property get_fname_sux_suy[source]
_filename_cl: str[source]
bordersX: dict[source]
bordersY: dict[source]
dx: float[source]
dy: float[source]
orig: list[float, float][source]
init_2D()[source]

Init wx Frame

OnClose(event: wx.MouseEvent)[source]

Close the window

OnDestroy(event: wx.MouseEvent)[source]

Close the window

LoadFile(filename: str)[source]

Read file

Parameters:

filename – name of file to read

OnLoad(event: wx.MouseEvent)[source]

Click on Load button

SaveFile(filename: str = None)[source]

Save to file

Parameters:

filename – name of file to write

OnSave(event: wx.MouseEvent)[source]

Click on Save button

FindBC(bc_type: str) tuple[str, str][source]

Find indices of borders with associated ‘whichbc’ value

param whichbc:

type of BC to find

:return 2 strings with indices along X and Y – ‘i j

OnFind(event: wx.MouseEvent)[source]

Find all borders associated with and put strings in widgets

OnSetBC(event: wx.MouseEvent)[source]

Click on Apply button

Parse BC from textboxes and apply to memory

resetBC()[source]

Reset all wx widgets related to BC

OnResetBC(event: wx.MouseEvent)[source]

Click on Reset button

GetBC()[source]

Get BC for selected borders

OnGetBC(event: wx.MouseEvent)[source]

Click on Get button

Clearselection()[source]

Clear selection

OnClearselection(event: wx.MouseEvent)[source]

Clear selection

OnFindBorders(event: wx.MouseEvent)[source]

Click on Find borders Button

Parsing of textboxes and update selection

update_selection()[source]
_Populate_selxy()[source]

Set selected along X and Y

_Populate_FileContent()[source]

Update file content

_script_bc()[source]

Return script to apply BC

send_to_wolfparent()[source]

Send BC to parent

parse(text: str)[source]

Parse text and fill bordersX and bordersY

OnFileCmd(event: wx.MouseEvent)[source]

Apply <<< button

OnCopyToClipboard(event: wx.MouseEvent)[source]

Copy to clipboard

FindBorders(array: numpy.ma.array = None)[source]

Find all borders where we can impose BC

ReadFileBorders(*args)[source]

Read sux and suy files

Provide path to .sux file .suy file is supposed to be in the same directory

_ComputeCoordinates()[source]

Calculate and store positions of possible BC

_nb_bc(bc: dict) int[source]

Count number of BC for border ‘bc’

Parameters:

bc – dict of BC for a border

_get_index(key: str, dictXY: dict) int[source]

Get index of key in dictXY

Parameters:
  • key – key to find

  • dictXY – dictionary of borders – self.borderX or self.borderY

default_colors()[source]

allocate colors and set default to black

update_colors()[source]

Update colors for OpenGL

_color_bc()[source]

Color borders according to number of BC

_get_colors() numpy.ndarray[source]

Concatenate colors for X and Y

_get_coords() numpy.ndarray[source]

Concatenate coordinates for X and Y

_plot_init()[source]

Initialize OpenGL - Program shader

_update_buffer()[source]

Update OpenGL buffer

plot()[source]

Plot borders – OpenGL

_do_kdtree()[source]

Create kdtree to search nearest neighbor

query_kdtree(point: tuple[float, float])[source]

Find nearest border and add to ‘selected’ dict

ray_tracing_numpy(poly, XorY: str = 'x')[source]

Find all borders in rectangle or polygon and addto ‘selected’ dict

_find_Str_TypeBC(i: int)[source]

Convert intBC to nameBC

_find_Int_TypeBC(name: str)[source]

Convert nameBC to intBC

_find_EnumName_TypeBC(name: str)[source]

Convert nameBC to intBC

_find_Enum_TypeBC(name: str)[source]

Convert nameBC to intBC

get_lists_for_GPU() tuple[list[wolfhece.mesh2d.wolf2dprev.boundary_condition_2D], list[wolfhece.mesh2d.wolf2dprev.boundary_condition_2D]][source]

Return list of BC for GPU computing