Пример #1
0
 public LevelSetLogger(XModel model, TrackingExteriorCrackLSM lsm, string outputDirectory)
 {
     this.model           = model;
     this.lsm             = lsm;
     this.outputDirectory = outputDirectory;
     this.vtkMesh         = new VtkMesh <XNode>(model.Nodes, model.Elements);
 }
 private static void PrintMeshOnly(Model model)
 {
     try
     {
         Node[]         nodes    = model.Nodes.ToArray();
         ICell <Node>[] elements = model.Elements.Select(element => (ICell <Node>)element).ToArray();
         var            mesh     = new VtkMesh <Node>(nodes, elements);
         using (var writer = new VtkFileWriter(workingDirectory + "\\mesh.vtk"))
         {
             writer.WriteMesh(mesh);
         }
     }
     catch (InvalidCastException ex)
     {
         throw new InvalidCastException("VtkLogFactory only works for models with elements that implement ICell.", ex);
     }
 }