# HG changeset patch # User greg # Date 1452522100 18000 # Node ID 22bb80483a8d242a30a5a9432dcffa612a651e4f # Parent d7c8a1ad787ddf3239d6b37a389b952c30bf183a Uploaded diff -r d7c8a1ad787d -r 22bb80483a8d icqsol_utils.py --- a/icqsol_utils.py Wed Dec 09 11:03:10 2015 -0500 +++ b/icqsol_utils.py Mon Jan 11 09:21:40 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,18 @@ 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, dataset_type): + # Instantiate a 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.