added test

This commit is contained in:
f.basile 2020-11-25 12:51:52 +01:00
parent eb085958f8
commit 31df4c04c8
8 changed files with 249 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<VTKFile type="RectilinearGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
<RectilinearGrid WholeExtent="0 12 0 15 0 20">
<FieldData>
<Array type="String" Name="comments" NumberOfTuples="1" format="binary">
AQAAAACAAABdAAAAYAAAAA==eF4NwlsKgCAQAMCO4mcRK6tmrwt0g35jKXuQtqHR+WuYhQKlUw6Og1wjh2nkyBcf0+NSct7Tc/AlXiNRIpC/dwJra9hW03Tk5qUVuUaNoBRoKxT2lf6XqBCL7APiGxu3
</Array>
</FieldData>
<Piece Extent="0 12 0 15 0 20">
<PointData>
</PointData>
<CellData>
<DataArray type="Int64" Name="material" format="binary" RangeMin="0" RangeMax="3">
AQAAAACAAACAcAAAFwQAAA==eF7t2sFuYzkQQ9Gk+///uTddm0KIy6JUdmCbG2KAV0e2n6QBJvP19XO+//cf0X9FU77NnroVcnu7ISf1aZ663ocKzStPdYWcqdv31S3P3bc0R63cV/Er5KRuhbxTv0Lus32Kex6moXNX7X7OHnJ7uyEn9WnebRWaU03vm+anbt+v5Lieex623O37s4ec3+5XyEvdCrnKn8b1p6FzkYbc03XIS31yUp/m3VahObd76HlqtV9pbuqp80De1KXznHrTe4gc16eQp3w35PVOQ+70c/eQn4b2bRpyT9chL/XJSX2ad1uF5tzuoefd7vuVnndbnQeam3rqPPffLfXS80xO6lbIO/UrW25l21fv+zS0X9OQe7oOealPTurTvNsqNOd2Dz0/7Qo9N+1+Luh5avc8T7+X67oh79SvbLmVbb+y5dJ+T0P7KQ25p+uQl/rkpD7Nu61Cc2730PPTrtBzad+6n7unznP6vW7dQ+Slbs+2X9lyK1s+7fc0tI/SkHu6DnmpT07q07zbKjTndg89P+0KPfdbu+f0e53eE8rbuoe23Mq2T+8zjbtfpqH9k4bc03XIS31yUp/m3VahObd76PlpV+i5tKd/F5y2+ntg/+dpp3+f2nJVtu/P7fTf51bU738aer9pyD1dh7zUJyf1ad5tFZpzu4een3aFnkt7635W/1/F6fdy/38NlS1Xpe7lR/u30n+fW1Hv4TS0f9KQe7oOealPTurTvNsqNOd2Dz0/7Wfdn2krV90f5FXTPefeT8p1fTdbbg/5p6H3mob2TxraR6lPbu9pyEt9clKf5t1WoTm3e+h5t7fuT/LTdeiemK6j/rsweXT+6O925KY+ea5fSX03U38adz9Ok+53Cu1/tY4bcnu7ISf1ad5tFZpzu78Hep6azgPNk0u+u96te6ivc+v+7E1u6vfc8lVOXfIr276731P3tk/ni9xTn9ZRIY/WUaF5t1VoTjW9b5pXXnoepu7UrybvUT45r+pXbvs9W27llv/oz0/nmLxT312nh7zUJ8e9l04/9+l52HK7T17qV5P3Kj45Hz/rym33UT6dX5qnz033EDmpm65DjnsvpZ+bXPe9TL2pX01O6n58r8lL3XfxaZ5626d1aI6a7iGan7qn/55xPWp3HXJSn+apn+2n65D3rj45Hz9rcrd9mqeme47mXffWOq7ndvq7U9P3oHnqZ/vpOuR9/FmTl7of32u6f2hedYXuO3Km7uk6rue2+7nJmb4Xmqd+dT9dh7yPP2vyUnfb77nl97j3BLmu35u81J3e0xVy6Hfq3XPLpe+TeuRO9/27+uk65L2rT86jfJVTX8W9J2777j2tQh6to0Lz7u+lQs70Xq3vc8tz3/uWOz1Xv9VP1yHvVfwKeVNf5dSt/gdcjxTB
</DataArray>
</CellData>
<Coordinates>
<DataArray type="Float64" Name="x" format="binary" RangeMin="0" RangeMax="1">
AQAAAACAAABoAAAANAAAAA==eF5jYICAUDDYag+hj9pDRC9A+VftV4HBLaj4Ayj/EVT+KVT8BVT8FVT8LVT8gz0An9sjLg==
</DataArray>
<DataArray type="Float64" Name="y" format="binary" RangeMin="0" RangeMax="1">
AQAAAACAAACAAAAASAAAAA==eF5jYIAAQTDYaA+hD9rPmgkCJ6H8i/ahYHAVKn7T/t5dMIDKP7Q3BoPHUHVP7cvB4DlU/Uv7PbtB4DVU31t7iK0f7AHaRzOg
</DataArray>
<DataArray type="Float64" Name="z" format="binary" RangeMin="0" RangeMax="1">
AQAAAACAAACoAAAAVQAAAA==eF5jYICAWTNBYKU9hN5pb2IMAoeh/JP2EFUXoOKX7dPTQOAaVP6m/dkzIHAHqu4BVPwhVP1jqPwTqL5nUHUvoOpeQtW9hqp7A1X3Dqrugz0ASSZF3Q==
</DataArray>
</Coordinates>
</Piece>
</RectilinearGrid>
</VTKFile>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -363,3 +363,12 @@ class TestGeom:
grid = np.ones(3,dtype=int)*64
geom = Geom.from_minimal_surface(grid,np.ones(3),surface,threshold)
assert np.isclose(np.count_nonzero(geom.material==1)/np.prod(geom.grid),.5,rtol=1e-3)
@pytest.mark.parametrize('periodic',[True,False])
@pytest.mark.parametrize('direction',['x','y','z'])
def test_get_grain_boundaries(self,periodic,direction,reference_dir):
geom=Geom.load(reference_dir/'get_grain_boundaries_4g12x15x20.vtr')
current=geom.get_grain_boundaries(periodic,direction)
reference=VTK.load(reference_dir/f'get_grain_boundaries_4g12x15x20_{direction}_per{periodic}.vtu')
assert current == reference