Ejemplo n.º 1
0
        private void Update2DGrid()
        {
            /// Retrieve mesh names from archive
            string meshName2D = VrnReader.Retrieve2DMeshName(VisualInflation, RefinementLevel);

            /// Empty 2D grid which stores geometry + mapping data
            Grid2D = new Grid(new Mesh(), meshName2D);
            Grid2D.Attach(new MappingAttachment());
            VrnReader.ReadUGX(meshName2D, ref grid2D);
        }
Ejemplo n.º 2
0
            static void Main(string[] args)
            {
                string fileName = "testNew.vrn";

                try
                {
                    /// Instantiate the VRN reader with the desired file name
                    VrnReader reader = new VrnReader(fileName);
                    /// Get the name of the 1d mesh (0-th refinement aka coarse grid)
                    Console.WriteLine(reader.Retrieve1DMeshName());
                    /// Get the name of the inflated 2d mesh by a factor of 2.5
                    Console.WriteLine(reader.Retrieve2DMeshName(2.5));
                }
                catch (Exception ex) when(ex is System.IO.FileNotFoundException || ex is System.ArgumentNullException)
                {
                    Console.Error.WriteLine($"Archive not found or unable to open the .vrn archive: {fileName}.");
                    Console.Error.WriteLine(ex);
                }
                catch (Exception ex) when(ex is CouldNotReadMeshFromVRNArchive)
                {
                    Console.Error.WriteLine($"Requested mesh not contained in MetaInfo.json or given .vrn archive {fileName}.");
                    Console.Error.WriteLine(ex);
                }
            }