-
Notifications
You must be signed in to change notification settings - Fork 6
Add Plotter2D class for 2D visualization with comprehensive tests #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…o 3D_Tetra-ifol
Update Branch
Supports torsion, uniform stretch / compression, simple shear.
Merge origin/main into 3D_Tetra-ifol: migrate setup.py → pyproject.toml
case_dir = os.path.join('.', "Folder_with_vtk_files")
vtk_files = glob.glob(os.path.join(case_dir, "*.vtk"))
if vtk_files:
vtk_path = vtk_files[0]
config = {
"cmap": "coolwarm",
"u_fol_prefix": "U_FOL_",
"u_fe_prefix": "U_HFE_",
"output_image": "overview2d.png",
"warp_factor_2d": 1.2, #
"scalar_bar_args": { #
"title": "",
"vertical": True,
"label_font_size": 20,
"height": .9,
"width": 0.09,
},
"zoom": 1.2,
"clip": False,
"show_edges": True,
"window_size": (1600, 1000),
}
plotter = Plotter2D(vtk_path=vtk_path, config=config)
plotter.render_all_panels()
else:
print("No .vtk file found to visualize.")
RezaNajian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerrypaulvarghese Thanks for extending the plot function to 2D. I believe hyper_elasticity_2d.py was added by accident—please remove it. Also, could you add a test for the 2D plotter?
- Test 2D mesh validation (rejects non-flat meshes) - Test initialization and configuration - Test best sample selection by minimum error - Test magnitude field creation from vector fields - Test mesh warping functionality - Test panel rendering (single and all panels) - Test warp factor configuration - Test error handling for missing required fields All 9 tests passing successfully.
|
Removed the plot_solver_convergence function and its documentation.
Changes
Plotter2Dclass infol/tools/plotter.pyfor flat 2D mesh visualizationtests/unit/test_plotter2d.py(9 tests, all passing)Features
Testing
All tests passing