@@ -491,13 +491,17 @@ void cvOneDBFSolver::postprocess_VTK_XML3D_ONEFILE(){
491491 currCentre[2 ] = nodeList[inletSegJoint][2 ] + loopEl*lengthByNodes/double (currSeg->getNumElements ())*segVers[2 ][0 ];
492492
493493 // Get initial radius at current location
494-
495- // TODO: verify this is the correct "z" location we want
496- // to interpolate at. These loops and myriad variables make
497- // something super simple super confusing.
498- auto const [inletZ, outletZ] = currSeg->getSpatialCharacteristics ().inletAndOutletZCoordinates ();
499- double const zAxial = linearEstimate (loopEl, 0 , inletZ, currSeg->getNumElements (), outletZ);
500- currIniRad = currSeg->getSpatialCharacteristics ().getInterpolatedRadius (zAxial);
494+ //
495+ // TODO: This should be updated to utilize the spatial characteristics.
496+ // Right now, this won't use the interior points of a spatially varying vessel.
497+ // Instead, it uses the legacy values of the input and output areas.
498+ // Why?
499+ // We're planning to update the VTK files in an independent change. When that's
500+ // done, we can verify that we are using the spatially varying areas correctly
501+ // when building the VTK output.
502+ auto const [inletArea, outletArea] = currSeg->getSpatialCharacteristics ().inletAndOutletAreas ();
503+ currIniArea = inletArea + (loopEl/double (currSeg->getNumElements ()))*(outletArea - inletArea);
504+ currIniRad = sqrt (currIniArea/M_PI);
501505
502506 // Loop on the subdivisions
503507 for (int loopSubdiv=0 ;loopSubdiv<circSubdiv;loopSubdiv++){
@@ -571,14 +575,16 @@ void cvOneDBFSolver::postprocess_VTK_XML3D_ONEFILE(){
571575 for (int j=startOut;j<finishOut;j+=2 ){
572576
573577 // Evaluate Initial Area at current location
574-
575- // TODO: verify this is the correct "z" location we want
576- // to interpolate at. These loops and myriad variables make
577- // something super simple super confusing.
578- auto const [inletZ, outletZ] = currSeg->getSpatialCharacteristics ().inletAndOutletZCoordinates ();
579- double const zAxial = linearEstimate ((j-startOut)/2.0 ,
580- startOut, inletZ, finishOut,outletZ);
581- iniArea = currSeg->getSpatialCharacteristics ().getInterpolatedArea (zAxial);
578+ //
579+ // TODO: This should be updated to utilize the spatial characteristics.
580+ // Right now, this won't use the interior points of a spatially varying vessel.
581+ // Instead, it uses the legacy values of the input and output areas.
582+ // Why?
583+ // We're planning to update the VTK files in an independent change. When that's
584+ // done, we can verify that we are using the spatially varying areas correctly
585+ // when building the VTK output.
586+ auto const [inletArea, outletArea] = currSeg->getSpatialCharacteristics ().inletAndOutletAreas ();
587+ iniArea = inletArea + (((j-startOut)/2 )/double (currSeg->getNumElements ()))*(outletArea - inletArea);
582588
583589 // Eval Current Area at current location
584590 newArea = TotalSolution[loopTime][j];
@@ -844,13 +850,17 @@ void cvOneDBFSolver::postprocess_VTK_XML3D_MULTIPLEFILES(){
844850 currCentre[2 ] = nodeList[inletSegJoint][2 ] + loopEl*lengthByNodes/double (currSeg->getNumElements ())*segVers[2 ][0 ];
845851
846852 // Get initial radius at current location
847-
848- // TODO: verify this is the correct "z" location we want
849- // to interpolate at. These loops and myriad variables make
850- // something super simple super confusing.
851- auto const [inletZ, outletZ] = currSeg->getSpatialCharacteristics ().inletAndOutletZCoordinates ();
852- double const zAxial = linearEstimate (loopEl, 0 , inletZ, currSeg->getNumElements (), outletZ);
853- currIniRad = currSeg->getSpatialCharacteristics ().getInterpolatedRadius (zAxial);
853+ //
854+ // TODO: This should be updated to utilize the spatial characteristics.
855+ // Right now, this won't use the interior points of a spatially varying vessel.
856+ // Instead, it uses the legacy values of the input and output areas.
857+ // Why?
858+ // We're planning to update the VTK files in an independent change. When that's
859+ // done, we can verify that we are using the spatially varying areas correctly
860+ // when building the VTK output.
861+ auto const [inletArea, outletArea] = currSeg->getSpatialCharacteristics ().inletAndOutletAreas ();
862+ currIniArea = inletArea + (loopEl/double (currSeg->getNumElements ()))*(outletArea - inletArea);
863+ currIniRad = sqrt (currIniArea/M_PI);
854864
855865 // Loop on the subdivisions
856866 for (int loopSubdiv=0 ;loopSubdiv<circSubdiv;loopSubdiv++){
@@ -922,14 +932,16 @@ void cvOneDBFSolver::postprocess_VTK_XML3D_MULTIPLEFILES(){
922932 for (int j=startOut;j<finishOut;j+=2 ){
923933
924934 // Evaluate Initial Area at current location
925-
926- // TODO: verify this is the correct "z" location we want
927- // to interpolate at. These loops and myriad variables make
928- // something super simple super confusing.
929- auto const [inletZ, outletZ] = currSeg->getSpatialCharacteristics ().inletAndOutletZCoordinates ();
930- double const zAxial = linearEstimate ((j-startOut)/2.0 ,
931- startOut, inletZ, finishOut, outletZ);
932- iniArea = currSeg->getSpatialCharacteristics ().getInterpolatedArea (zAxial);
935+ //
936+ // TODO: This should be updated to utilize the spatial characteristics.
937+ // Right now, this won't use the interior points of a spatially varying vessel.
938+ // Instead, it uses the legacy values of the input and output areas.
939+ // Why?
940+ // We're planning to update the VTK files in an independent change. When that's
941+ // done, we can verify that we are using the spatially varying areas correctly
942+ // when building the VTK output.
943+ auto const [inletArea, outletArea] = currSeg->getSpatialCharacteristics ().inletAndOutletAreas ();
944+ iniArea = inletArea + (((j-startOut)/2 )/double (currSeg->getNumElements ()))*(outletArea - inletArea);
933945
934946 // Eval Current Area at current location
935947 newArea = TotalSolution[loopTime][j];
0 commit comments