Mercurial > repos > greg > icqsol_add_surface_field_from_expression
changeset 17:114910538a37 draft
Uploaded
author | greg |
---|---|
date | Tue, 12 Jul 2016 10:51:04 -0400 |
parents | 45ce63c33019 |
children | 5fa6da075198 |
files | icqsol_add_surface_field_from_expression.py icqsol_utils.py tool_dependencies.xml |
diffstat | 3 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/icqsol_add_surface_field_from_expression.py Fri Jul 08 10:34:38 2016 -0400 +++ b/icqsol_add_surface_field_from_expression.py Tue Jul 12 10:51:04 2016 -0400 @@ -37,10 +37,12 @@ args.max_edge_length, args.location) -# Write min/max field values. +# Write min/max field values and surface integral. for comp in range(len(time_points)): minVal, maxVal = shape_mgr.getFieldRange(vtk_poly_data, args.field_name, comp) - print 'component {2} min/max values of field {3}: {0}/{1}'.format(minVal, maxVal, comp, args.field_name) + surfIntegral = shape_mgr.integrateSurfaceField(vtk_poly_data, args.field_name, comp) + print 'component {2} min/max values of {3}: {0}/{1} surf integral: {4}'.format(minVal, maxVal, comp, args.field_name, surfIntegral) + # Define the output file format and type (the outpur_format can only be 'vtk'). output_format, output_file_type = icqsol_utils.get_format_and_type(args.output_vtk_type) tmp_output_path = icqsol_utils.get_temporary_file_path(tmp_dir, output_format)
--- a/icqsol_utils.py Fri Jul 08 10:34:38 2016 -0400 +++ b/icqsol_utils.py Tue Jul 12 10:51:04 2016 -0400 @@ -48,12 +48,7 @@ def get_shape_manager(format=None, dataset_type=None): # Instantiate a ShapeManager. - if format is None and dataset_type is None: - return ShapeManager() - if format == VTK: - return ShapeManager(file_format=format, vtk_dataset_type=dataset_type) - else: - return ShapeManager(file_format=format) + return ShapeManager(file_format=format, vtk_dataset_type=dataset_type) def get_temp_dir(prefix='tmp-vtk-', dir=None):
--- a/tool_dependencies.xml Fri Jul 08 10:34:38 2016 -0400 +++ b/tool_dependencies.xml Tue Jul 12 10:51:04 2016 -0400 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <tool_dependency> <package name="icqsol" version="1.0"> - <repository changeset_revision="a357536fb363" name="package_icqsol_1_0" owner="greg" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <repository changeset_revision="8ce91708b876" name="package_icqsol_1_0" owner="greg" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> </tool_dependency>