#5318 Surface Intersection geometry with results

This commit is contained in:
Jacob Støren
2020-01-17 13:23:37 +01:00
parent 67b47bd07e
commit d32db574cb
15 changed files with 925 additions and 95 deletions

View File

@@ -190,21 +190,27 @@ void RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMech
#pragma omp parallel for schedule( dynamic )
for ( int triangleVxIdx = 0; triangleVxIdx < vxCount; ++triangleVxIdx )
{
float resValue = 0;
int weightCount = vertexWeights[triangleVxIdx].size();
for ( int wIdx = 0; wIdx < weightCount; ++wIdx )
{
size_t resIdx;
if ( isElementNodalResult )
{
resIdx = vertexWeights[triangleVxIdx].vxId( wIdx );
}
else
{
resIdx = femPart->nodeIdxFromElementNodeResultIdx( vertexWeights[triangleVxIdx].vxId( wIdx ) );
}
float resValue = HUGE_VAL;
resValue += resultValues[resIdx] * vertexWeights[triangleVxIdx].weight( wIdx );
int weightCount = vertexWeights[triangleVxIdx].size();
if ( weightCount )
{
resValue = 0;
for ( int wIdx = 0; wIdx < weightCount; ++wIdx )
{
size_t resIdx;
if ( isElementNodalResult )
{
resIdx = vertexWeights[triangleVxIdx].vxId( wIdx );
}
else
{
resIdx = femPart->nodeIdxFromElementNodeResultIdx( vertexWeights[triangleVxIdx].vxId( wIdx ) );
}
resValue += resultValues[resIdx] * vertexWeights[triangleVxIdx].weight( wIdx );
}
}
if ( resValue == HUGE_VAL || resValue != resValue ) // a != a is true for NAN's

View File

@@ -123,7 +123,7 @@ public:
Where the k's are normalized distances along the edge, from the edge start vertex .
This is the interpolation sceme:
This is the interpolation scheme:
v = (1 - k )* v1 + k *v2;
@@ -205,6 +205,13 @@ public:
m_weights[1] = ( (float)( normDistFromE1V1 ) );
}
explicit RivIntersectionVertexWeights( const std::array<size_t, 8> vxIds, const std::array<double, 8> explicitWeights )
: m_count( 8 )
, m_vxIds( vxIds )
{
std::copy( explicitWeights.begin(), explicitWeights.end(), m_weights.begin() );
}
int size() const
{
return m_count;