def is_solenoidal(field):
 if (not isinstance(field, Vector)):
  raise TypeError('field should be a Vector')
 if (field == Vector.zero):
  return True
 coord_sys = list(field.separate())[0]
 return (divergence(field, coord_sys).simplify() == S(0))

def is_solenoidal ( field ) : if ( not isinstance ( field , Vector ) ) : raise TypeError ( 'field should be a Vector' ) if ( field == Vector . zero ) : return True coord_sys = list ( field . separate ( ) ) [ 0 ] return ( divergence ( field , coord_sys ) . simplify ( ) == S ( 0 ) )
checks if a field is solenoidal .