Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VTKm
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Steven Walton
VTKm
Commits
ccedb5aa
Commit
ccedb5aa
authored
Sep 17, 2019
by
Hank Childs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jacobian working, unit test working
parent
560aa1f6
Changes
6
Expand all
Hide whitespace changes
Inline
Sidebyside
Showing
6 changed files
with
1898 additions
and
428 deletions
+1898
428
vtkm/exec/cellmetrics/CellJacobianMetric.h
vtkm/exec/cellmetrics/CellJacobianMetric.h
+68
159
vtkm/exec/cellmetrics/TypeOfCellHexahedral.h
vtkm/exec/cellmetrics/TypeOfCellHexahedral.h
+765
0
vtkm/exec/cellmetrics/TypeOfCellQuadrilateral.h
vtkm/exec/cellmetrics/TypeOfCellQuadrilateral.h
+468
0
vtkm/exec/cellmetrics/TypeOfCellTetrahedral.h
vtkm/exec/cellmetrics/TypeOfCellTetrahedral.h
+295
0
vtkm/exec/cellmetrics/TypeOfCellTriangle.h
vtkm/exec/cellmetrics/TypeOfCellTriangle.h
+192
0
vtkm/filter/testing/UnitTestMeshQualityFilter.cxx
vtkm/filter/testing/UnitTestMeshQualityFilter.cxx
+110
269
No files found.
vtkm/exec/cellmetrics/CellJacobianMetric.h
View file @
ccedb5aa
This diff is collapsed.
Click to expand it.
vtkm/exec/cellmetrics/TypeOfCellHexahedral.h
0 → 100644
View file @
ccedb5aa
This diff is collapsed.
Click to expand it.
vtkm/exec/cellmetrics/TypeOfCellQuadrilateral.h
0 → 100644
View file @
ccedb5aa
This diff is collapsed.
Click to expand it.
vtkm/exec/cellmetrics/TypeOfCellTetrahedral.h
0 → 100644
View file @
ccedb5aa
This diff is collapsed.
Click to expand it.
vtkm/exec/cellmetrics/TypeOfCellTriangle.h
0 → 100644
View file @
ccedb5aa
#ifndef vtk_m_exec_cellmetrics_TypeOfCellTriangle
#define vtk_m_exec_cellmetrics_TypeOfCellTriangle
/**
* The Verdict manual defines a set of commonly
* used components of a triangle. For example,
* area, side lengths, and so forth.
*
* These definitions can be found starting on
* page 17 of the Verdict manual.
*
* This file contains a set of functions which
* implement return the values of those commonly
* used components for subsequent use in metrics.
*/
/**
* Returns the L0 vector, as defined by the verdict manual.
*
* \param [in] pts The three points which define the triangle.
* \return Returns the vector.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Vector
GetTriangleL0
(
const
CollectionOfPoints
&
pts
)
{
const
Vector
L0
(
pts
[
2
]

pts
[
1
]);
return
L0
;
}
/**
* Returns the L1 vector, as defined by the verdict manual.
*
* \param [in] pts The three points which define the triangle.
* \return Returns the vector.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Vector
GetTriangleL1
(
const
CollectionOfPoints
&
pts
)
{
const
Vector
L1
(
pts
[
0
]

pts
[
2
]);
return
L1
;
}
/**
* Returns the L2 vector, as defined by the verdict manual.
*
* \param [in] pts The three points which define the triangle.
* \return Returns the vector.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Vector
GetTriangleL2
(
const
CollectionOfPoints
&
pts
)
{
const
Vector
L2
(
pts
[
1
]

pts
[
0
]);
return
L2
;
}
/**
* Returns the L0 vector's magnitude, as defined by the verdict manual.
*
* \param [in] pts The three points which define the triangle.
* \return Returns the magnitude of the vector.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleL0Magnitude
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
l0
=
vtkm
::
Sqrt
(
vtkm
::
MagnitudeSquared
(
GetTriangleL0
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
)));
return
l0
;
}
/**
* Returns the L1 vector's magnitude, as defined by the verdict manual.
*
* \param [in] pts The three points which define the triangle.
* \return Returns the magnitude of the vector.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleL1Magnitude
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
l1
=
vtkm
::
Sqrt
(
vtkm
::
MagnitudeSquared
(
GetTriangleL1
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
)));
return
l1
;
}
/**
* Returns the L2 vector's magnitude, as defined by the verdict manual.
*
* \param [in] pts The three points which define the triangle.
* \return Returns the magnitude of the vector.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleL2Magnitude
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
l2
=
vtkm
::
Sqrt
(
vtkm
::
MagnitudeSquared
(
GetTriangleL2
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
)));
return
l2
;
}
/**
* Returns the Max of the magnitude of each vector which makes up the sides of the triangle.
*
* That is to say, the length of the longest side.
*
* \param [in] pts The three points which define the verticies of the triangle.
*
* \return Returns the max of the triangle side lengths.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleLMax
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
l0
=
GetTriangleL0Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l1
=
GetTriangleL1Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l2
=
GetTriangleL2Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
lmax
=
vtkm
::
Max
(
l0
,
vtkm
::
Max
(
l1
,
l2
));
return
lmax
;
}
/**
* Returns the Min of the magnitude of each vector which makes up the sides of the triangle.
*
* That is to say, the length of the shortest side.
*
* \param [in] pts The three points which define the verticies of the triangle.
*
* \return Returns the max of the triangle side lengths.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleLMin
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
l0
=
GetTriangleL0Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l1
=
GetTriangleL1Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l2
=
GetTriangleL2Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
lmin
=
vtkm
::
Min
(
l0
,
vtkm
::
Min
(
l1
,
l2
));
return
lmin
;
}
/**
* Returns the area of the triangle.
*
* \param [in] pts The three points which define the verticies of the triangle.
*
* \return Returns the are of the triangle..
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleArea
(
const
CollectionOfPoints
&
pts
)
{
const
Vector
L0
=
GetTriangleL0
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Vector
L1
=
GetTriangleL1
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
half
(
0.5
);
const
Scalar
crossProductMagnitude
=
vtkm
::
Sqrt
(
vtkm
::
MagnitudeSquared
(
vtkm
::
Cross
(
L0
,
L1
)));
const
Scalar
area
=
half
*
crossProductMagnitude
;
return
area
;
}
/**
* Returns the radius of a circle inscribed within the given triangle. This is commonly denoted as 'r'.
*
* \param [in] pts The three points which define the verticies of the triangle.
*
* \return Returns the inradius.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleInradius
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
two
(
2.0
);
const
Scalar
area
=
GetTriangleArea
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l0
=
GetTriangleL0Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l1
=
GetTriangleL1Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l2
=
GetTriangleL2Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
inradius
=
(
two
*
area
)
/
(
l0
+
l1
+
l2
);
return
inradius
;
}
/**
* Returns the radius of a circle circumscribed around the given triangle. This is commonly denoted as 'R'.
*
* \param [in] pts The three points which define the verticies of the triangle.
*
* \return Returns the circumradius.
*/
template
<
typename
Scalar
,
typename
Vector
,
typename
CollectionOfPoints
>
VTKM_EXEC
Scalar
GetTriangleCircumradius
(
const
CollectionOfPoints
&
pts
)
{
const
Scalar
four
(
4.0
);
const
Scalar
area
=
GetTriangleArea
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l0
=
GetTriangleL0Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l1
=
GetTriangleL1Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
l2
=
GetTriangleL2Magnitude
<
Scalar
,
Vector
,
CollectionOfPoints
>
(
pts
);
const
Scalar
circumradius
=
(
l0
*
l1
*
l2
)
/
(
four
*
area
);
return
circumradius
;
}
#endif
vtkm/filter/testing/UnitTestMeshQualityFilter.cxx
View file @
ccedb5aa
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment