# Viewing Mesh/Grid Internal to Subdomains

6 messages
Open this post in threaded view
|

## Viewing Mesh/Grid Internal to Subdomains

 If I create a model consisting of a cylinder enclosed/contained by/in a box: Once the Mesh/Grid is generated ... ... how can I see what the mesh looks like on the surface of the cylinder and in the space between it and the box boundaries?
Open this post in threaded view
|

## Re: Viewing Mesh/Grid Internal to Subdomains

 Administrator Partial views of meshes (or any mesh view control) have not yet been implemented in the FEATool GUI. This can however bee accomplished exporting the mesh to Matlab, using "Export Grid" > "To MATLAB Workspace" from the "Grid" menu and the plotgrid and selcells functions, for example the command    plotgrid( grid, 'selcells', selcells(grid,'y>0.5') ) will plot and show all grid cells for which the expression 'y>0.5' is true for all vertices. randress wrote If I create a model consisting of a cylinder enclosed/contained by/in a box: Once the Mesh/Grid is generated ... ... how can I see what the mesh looks like on the surface of the cylinder and in the space between it and the box boundaries?
Open this post in threaded view
|

## Re: Viewing Mesh/Grid Internal to Subdomains

 Precise Simulation wrote Partial views of meshes (or any mesh view control) have not yet been implemented in the FEATool GUI. This can however bee accomplished exporting the mesh to Matlab, using "Export Grid" > "To MATLAB Workspace" from the "Grid" menu and the plotgrid and selcells functions, for example the command    plotgrid( grid, 'selcells', selcells(grid,'y>0.5') ) will plot and show all grid cells for which the expression 'y>0.5' is true for all vertices. Good to know.   As I mentioned in another thread, having Matlab, while certainly not necessary for basic functionality, can provide a "bridge" between FEATool possible enhancements.   In my use case, I expect to have to be very judicious in creating grids - not wasting refinements here they are not needed - so that processing power necessary to view and solve will be kept as low as possible.  And (please correct me if I am wrong) most of the documentation on grid refinement must be accomplished in Matlab. For example, from the section "Grid Reference Material": In featool.com/doc, Grid Reference Material, the author wrote Due to the simple grid format syntax it is possible to manually import grids from other software. The process essentially consists of first exporting the grid point coordinates and grid cell connectivity data from the external grid generation tool into separate text files. Then import them into MATLAB, after which they can be reshaped and used by FEATool. ... This is not a criticism - all software has limitations - rather it reflects a wise design choice to maintain compatibility and interfaces to/from other relevant software. -Randal
Open this post in threaded view
|

## Re: Viewing Mesh/Grid Internal to Subdomains

 Administrator randress wrote And (please correct me if I am wrong) most of the documentation on grid refinement must be accomplished in Matlab. I would not say that you absolutely need Matlab to use a custom mesh as you can import in Gmsh, GiD formats too (and preprocess and edit them in any software you like). However, Matlab certainly allows you to do more things (easier) as basically all GUI functionality is also available with the Matlab command line interface (CLI), and the CLI functions also allows for much more functionality (although not as easily accessible). It can be especially convenient and useful to be able to export your GUI model as a Matlab script, and write loops around it if you for example want to run many similar simulation but with different parameters (in essence automating it and not requiring changing the GUI manually for each simulation run).
 In reply to this post by Precise Simulation Precise Simulation wrote Partial views of meshes (or any mesh view control) have not yet been implemented in the FEATool GUI. This can however bee accomplished exporting the mesh to Matlab, using "Export Grid" > "To MATLAB Workspace" from the "Grid" menu and the plotgrid and selcells functions, for example the command    plotgrid( grid, 'selcells', selcells(grid,'y>0.5') ) will plot and show all grid cells for which the expression 'y>0.5' is true for all vertices. This does seem to do the trick! However, if I first build a grid (which is displayed in full) and then after exporting the grid struc to Matlab I execute from within Matlab:  plotgrid( grid, 'selcells', selcells(grid,'y>0.5') )What seems to happen is that the subgrid displayed by plotgrid() is ADDED to the featool plot. If full transparency is set then it can be seen behind the full grid; if opaque, there is no observable change to the plot/display. How do I clear the featool plot area before using plotgrid?I have found that if I go to POST mode and then specify nothing to plot (or specify something that will not overlay with the sliced grid that I am interested in such as a planar slice) then execute plotgrid the sliced grid seems to display/plot just as expected. geometry.jpggridTransparent.jpggridTransparentWithplotgrid.jpgpostSettings.jpgpost.jpg
 Administrator randress wrote This does seem to do the trick! However, if I first build a grid (which is displayed in full) and then after exporting the grid struc to Matlab I execute from within Matlab:  plotgrid( grid, 'selcells', selcells(grid,'y>0.5') )What seems to happen is that the subgrid displayed by plotgrid() is ADDED to the featool plot. If full transparency is set then it can be seen behind the full grid; if opaque, there is no observable change to the plot/display. How do I clear the featool plot area before using plotgrid? By default the plot commands (postplot, plotgrid, plotgeom, plotsubd, plotbdr) draw in the main axis of the FEATool GUI if available, but you can also specify another figure as parent to plot in, for example  plotgrid( grid, 'selcells', selcells(grid,'y>0.5'), 'parent', figure ) Although there is not built-in GUI functionality to clear the plot window, if you still want to plot in the FEATool GUI axes you can use the workaround you have found to clear it. Alternatively, this Matlab command should also work  delete(setdiff(findall(findall(findall(0,'tag','featool_gui_main_window'),'type','axes')),findall(findall(0,'tag','featool_gui_main_window'),'type','axes'))) which essentially finds and deltes all children graphics handles of the FEATool plot widow (except for the axes). Furthermore, a menu option will be available in the next release to also specify grid cell selection in the FEATool GUI.