LCOV - code coverage report
Current view: top level - extern/mesquite - MsqFBiGeom.cpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 29 39 74.4 %
Date: 2020-07-01 15:24:36 Functions: 8 10 80.0 %
Branches: 20 60 33.3 %

           Branch data     Line data    Source code
       1                 :            : #include "meshkit/MKCore.hpp"
       2                 :            : #include "meshkit/MsqFBiGeom.hpp"
       3                 :            : 
       4                 :            : namespace MeshKit
       5                 :            : {
       6                 :            : 
       7                 :          3 : MsqFBiGeom::MsqFBiGeom( FBiGeom * ifbigeom,
       8                 :          3 :             iBase_EntityHandle geom_ent_handle )
       9                 :            : {
      10                 :          3 :   geomEntHandle = geom_ent_handle;
      11                 :          3 :   fbigeom = ifbigeom;
      12                 :          3 : }
      13                 :            : 
      14         [ -  + ]:          6 : MsqFBiGeom::~MsqFBiGeom() {}
      15                 :            : 
      16                 :          0 : void MsqFBiGeom::snap_to( Mesh::VertexHandle ,
      17                 :            :     Vector3D& coord ) const
      18                 :            : {
      19                 :            :   double x, y, z;
      20 [ #  # ][ #  # ]:          0 :   iBase_ErrorType err = fbigeom->getEntClosestPt(geomEntHandle, coord[0], coord[1], coord[2], x, y, z );
         [ #  # ][ #  # ]
      21         [ #  # ]:          0 :   IBERRCHK(err, "Failed to get closest point to surface.");
      22         [ #  # ]:          0 :   coord.set( x, y, z );
      23                 :          0 : }
      24                 :            : 
      25                 :          0 : void MsqFBiGeom::vertex_normal_at( Mesh::VertexHandle /*entity_handle*/,  // the mesh vertex handle is unused
      26                 :            :                          Vector3D& coord ) const
      27                 :            : {
      28                 :            :   double i, j, k;
      29 [ #  # ][ #  # ]:          0 :   iBase_ErrorType err = fbigeom->getEntNrmlXYZ( geomEntHandle, coord[0], coord[1], coord[2], i, j, k);
         [ #  # ][ #  # ]
      30         [ #  # ]:          0 :   IBERRCHK(err, "Failed to get normal to surface.");
      31         [ #  # ]:          0 :   coord.set( i, j, k );
      32                 :            : 
      33                 :          0 : }
      34                 :            : 
      35                 :       1458 : void MsqFBiGeom::element_normal_at( Mesh::ElementHandle /*entity_handle*/,  // the mesh element handle is unused
      36                 :            :                           Vector3D& coord ) const
      37                 :            : {
      38                 :            :   double i, j, k;
      39 [ +  - ][ +  - ]:       1458 :   iBase_ErrorType err = fbigeom->getEntNrmlXYZ( geomEntHandle, coord[0], coord[1], coord[2], i, j, k);
         [ +  - ][ +  - ]
      40         [ +  - ]:       1458 :   IBERRCHK(err, "Failed to get normal to surface.");
      41         [ +  - ]:       1458 :   coord.set( i, j, k );
      42                 :       1458 : }
      43                 :            : 
      44                 :        975 : void MsqFBiGeom::vertex_normal_at( const Mesh::VertexHandle* /*handles*/,
      45                 :            :                          Vector3D coordinates[],
      46                 :            :                          unsigned count,
      47                 :            :                          MsqError& err ) const
      48                 :            : {
      49         [ +  + ]:       5457 :   for (unsigned int i=0; i<count; i++)
      50                 :            :   {
      51                 :            :     double x, y, z;
      52         [ +  - ]:       4482 :     Vector3D coord =coordinates[i];
      53 [ +  - ][ +  - ]:       4482 :     iBase_ErrorType err = fbigeom->getEntNrmlXYZ( geomEntHandle, coord[0], coord[1], coord[2], x, y, z);
         [ +  - ][ +  - ]
      54         [ +  - ]:       4482 :     IBERRCHK(err, "Failed to get normal to surface.");
      55         [ +  - ]:       4482 :     coordinates[i].set( x, y, z );
      56                 :            :   }
      57                 :            : 
      58                 :        975 : }
      59                 :            : 
      60                 :       3715 : void MsqFBiGeom::closest_point( Mesh::VertexHandle handle,
      61                 :            :                       const Vector3D& position,
      62                 :            :                       Vector3D& closest,
      63                 :            :                       Vector3D& normal,
      64                 :            :                       MsqError& err ) const
      65                 :            : {
      66                 :            :   iBase_ErrorType ierr = fbigeom->getEntNrmlPlXYZ( geomEntHandle,
      67                 :       3715 :                            position[0], position[1], position[2],
      68                 :       3715 :                            closest[0], closest[1], closest[2],
      69                 :       7430 :                            normal[0],  normal[1],  normal[2]);
      70                 :       3715 :   IBERRCHK(ierr, "Failed to get normal and closest point to surface.");
      71                 :       3715 : }
      72                 :            : 
      73                 :        975 : void MsqFBiGeom::domain_DoF( const Mesh::VertexHandle* handle_array,
      74                 :            :                    unsigned short* dof_array,
      75                 :            :                    size_t num_vertices,
      76                 :            :                    MsqError& err ) const
      77                 :            : {
      78                 :            :   // just fill with 2, this is a surface, we know
      79         [ +  + ]:       5457 :   for (size_t i = 0; i< num_vertices; i++)
      80                 :            :   {
      81                 :       4482 :     dof_array[i]=2;
      82                 :            :   }
      83                 :        975 : }
      84                 :            : 
      85 [ +  - ][ +  - ]:        156 : }// end namespace

Generated by: LCOV version 1.11