:py:mod:`wolfhece.mesh2d.bc_manager` ==================================== .. py:module:: wolfhece.mesh2d.bc_manager .. autoapi-nested-parse:: 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 --------------- .. py:class:: 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) Bases: :py:obj:`wx.Frame` .. autoapi-inheritance-diagram:: wolfhece.mesh2d.bc_manager.BcManager :parts: 1 :private-bases: Boundary conditions Manager for WOLF .. py:property:: linked_array .. py:property:: get_fname_cl .. py:property:: get_fname_sux_suy .. py:attribute:: _filename_cl :type: str .. py:attribute:: bordersX :type: dict .. py:attribute:: bordersY :type: dict .. py:attribute:: dx :type: float .. py:attribute:: dy :type: float .. py:attribute:: orig :type: list[float, float] .. py:method:: init_2D() Init wx Frame .. py:method:: OnClose(event: wx.MouseEvent) Close the window .. py:method:: OnDestroy(event: wx.MouseEvent) Close the window .. py:method:: LoadFile(filename: str) Read file :param filename: name of file to read .. py:method:: OnLoad(event: wx.MouseEvent) Click on Load button .. py:method:: SaveFile(filename: str = None) Save to file :param filename: name of file to write .. py:method:: OnSave(event: wx.MouseEvent) Click on Save button .. py:method:: FindBC(bc_type: str) -> tuple[str, str] 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 ' .. py:method:: OnFind(event: wx.MouseEvent) Find all borders associated with and put strings in widgets .. py:method:: OnSetBC(event: wx.MouseEvent) Click on Apply button Parse BC from textboxes and apply to memory .. py:method:: resetBC() Reset all wx widgets related to BC .. py:method:: OnResetBC(event: wx.MouseEvent) Click on Reset button .. py:method:: GetBC() Get BC for selected borders .. py:method:: OnGetBC(event: wx.MouseEvent) Click on Get button .. py:method:: Clearselection() Clear selection .. py:method:: OnClearselection(event: wx.MouseEvent) Clear selection .. py:method:: OnFindBorders(event: wx.MouseEvent) Click on Find borders Button Parsing of textboxes and update selection .. py:method:: update_selection() .. py:method:: _Populate_selxy() Set selected along X and Y .. py:method:: _Populate_FileContent() Update file content .. py:method:: _script_bc() Return script to apply BC .. py:method:: send_to_wolfparent() Send BC to parent .. py:method:: parse(text: str) Parse text and fill bordersX and bordersY .. py:method:: OnFileCmd(event: wx.MouseEvent) Apply <<< button .. py:method:: OnCopyToClipboard(event: wx.MouseEvent) Copy to clipboard .. py:method:: FindBorders(array: numpy.ma.array = None) Find all borders where we can impose BC .. py:method:: ReadFileBorders(*args) Read sux and suy files Provide path to .sux file .suy file is supposed to be in the same directory .. py:method:: _ComputeCoordinates() Calculate and store positions of possible BC .. py:method:: _nb_bc(bc: dict) -> int Count number of BC for border 'bc' :param bc: dict of BC for a border .. py:method:: _get_index(key: str, dictXY: dict) -> int Get index of key in dictXY :param key: key to find :param dictXY: dictionary of borders -- self.borderX or self.borderY .. py:method:: default_colors() allocate colors and set default to black .. py:method:: update_colors() Update colors for OpenGL .. py:method:: _color_bc() Color borders according to number of BC .. py:method:: _get_colors() -> numpy.ndarray Concatenate colors for X and Y .. py:method:: _get_coords() -> numpy.ndarray Concatenate coordinates for X and Y .. py:method:: _plot_init() Initialize OpenGL - Program shader .. py:method:: _update_buffer() Update OpenGL buffer .. py:method:: plot() Plot borders -- OpenGL .. py:method:: _do_kdtree() Create kdtree to search nearest neighbor .. py:method:: query_kdtree(point: tuple[float, float]) Find nearest border and add to 'selected' dict .. py:method:: ray_tracing_numpy(poly, XorY: str = 'x') Find all borders in rectangle or polygon and addto 'selected' dict .. py:method:: _find_Str_TypeBC(i: int) Convert intBC to nameBC .. py:method:: _find_Int_TypeBC(name: str) Convert nameBC to intBC .. py:method:: _find_EnumName_TypeBC(name: str) Convert nameBC to intBC .. py:method:: _find_Enum_TypeBC(name: str) Convert nameBC to intBC .. py:method:: get_lists_for_GPU() -> tuple[list[wolfhece.mesh2d.wolf2dprev.boundary_condition_2D], list[wolfhece.mesh2d.wolf2dprev.boundary_condition_2D]] Return list of BC for GPU computing