# HG changeset patch # User greg # Date 1452523507 18000 # Node ID ff5b00e03acf254af7adb260cc20637967458d96 # Parent 5a220d650949999266d5e94a8554a9bc6b5d4a5f Uploaded diff -r 5a220d650949 -r ff5b00e03acf icqsol_utils.py --- a/icqsol_utils.py Wed Dec 09 11:03:50 2015 -0500 +++ b/icqsol_utils.py Mon Jan 11 09:45:07 2016 -0500 @@ -2,6 +2,9 @@ import sys import tempfile +from icqsol.shapes.icqShapeManager import ShapeManager +from icqsol.bem.icqLaplaceMatrices import LaplaceMatrices + PLY = 'ply' POLYDATA = 'POLYDATA' VTK = 'vtk' @@ -39,6 +42,20 @@ return file_path +def get_laplace_solver(shape_data, max_edge_length=float('inf')): + return LaplaceMatrices(shape_data, max_edge_length=max_edge_length) + + +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) + + def get_temp_dir(prefix='tmp-vtk-', dir=None): """ Return a temporary directory.