40 lines
997 B
C#
40 lines
997 B
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
#pragma warning disable IDE0130
|
|||
|
|
|
|||
|
|
namespace CaeMesh
|
|||
|
|
{
|
|||
|
|
[Serializable]
|
|||
|
|
public class GmshVolume : IComparable<GmshVolume>
|
|||
|
|
{
|
|||
|
|
public int Id;
|
|||
|
|
public HashSet<int> SurfaceIds;
|
|||
|
|
|
|||
|
|
public List<int> TriSurfIds;
|
|||
|
|
public List<int> QuadSurfIds;
|
|||
|
|
|
|||
|
|
public bool Transfinite;
|
|||
|
|
//
|
|||
|
|
public int NumTriSurfaces => TriSurfIds.Count;
|
|||
|
|
public int NumQuadSurfaces => QuadSurfIds.Count;
|
|||
|
|
|
|||
|
|
// 构造函数
|
|||
|
|
public GmshVolume(int id, int surfaceId)
|
|||
|
|
{
|
|||
|
|
Id = id;
|
|||
|
|
SurfaceIds = new HashSet<int> { surfaceId };
|
|||
|
|
TriSurfIds = new List<int>();
|
|||
|
|
QuadSurfIds = new List<int>();
|
|||
|
|
Transfinite = false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// IComparable接口
|
|||
|
|
public int CompareTo(GmshVolume other)
|
|||
|
|
{
|
|||
|
|
if (Id < other.Id) return 1;
|
|||
|
|
else if (Id > other.Id) return -1;
|
|||
|
|
else return 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|