Hello,
I am trying to use the exodus sizing function feature in Cubit to perform adaptive mesh refinement in my custom FEM code. The general flow of this process is as follows:
- Run my FEM code and estimate error in the solution
- Estimate the current sizes of each element (based on average edge lengths)
- Assign each element a new size, which is smaller than the current size when error is relatively high, and the same as the current size when it is relatively low.
- Write this information as a field in an exodus file
- Load the geometry into Cubit, delete the existing mesh, and create a new mesh using the exodus field.
- Start back at 1 with the new mesh
This process generally seems to work (partially due to your prior help, so thank you!), but I’m running into some strange issues that I was hoping I might be able to get some assistance with.
The first issue is that I’m seeing refinement around the boundary of the mesh that I don’t think I’m requesting to occur. The first mesh can be found here:
cpw_resonator_flush_coarse_finePorts.e (3.4 MB)
Plotting the cross section of the mesh on the XY plane, the outer tets are extremely coarse:
Now looking at the mesh after the first pass:
cpw_resonator_flush_coarse_finePorts_1.e (9.0 MB)
Refinement primarily occurs around the waveguide (which is expected), but there is also strangely some refinement near the outer boundary which forms an anti-symmetric pattern:
I thought this may have been due to an error in how I was requesting the sizes, but when I plot the field used for sizing (sizeFunc) in Paraview (loading in the first mesh), it looks like those elements are specified to be kept as large as those on the other side:
So I’m not really sure why these tets would be getting refined. I’ve attached a journal file performing this process here:
cubit21.jou (920 Bytes)
The Cubit file used here is also attached:
cpw_resonator_flush_coarse_finePorts.cub5 (4.2 MB)
Is there some issue with how I’m using the sizing function that’s causing these tets to get refined?
The other issue I’m seeing is that meshing using this procedure is surprisingly slow. Even for this first mesh, which only has 89730 tetrahedrons, meshing takes about 75 seconds, which seems quite slow. Is there something I’m doing that could be causing this to be substantially slower than it should be, or is meshing using a sizing function just intrinsically slow?
Thanks in advance for your help!
Sam Elkin