Пример #1
0
CubitStatus CAMergePartner::update()
{
  if (hasUpdated) return CUBIT_SUCCESS;
  
    // set the updated flag
  hasUpdated = CUBIT_TRUE;
  BasicTopologyEntity* bte_ptr = CAST_TO(attribOwnerEntity, BasicTopologyEntity);

  if( (bte_ptr == NULL) || (dynamic_cast<RefVolume*>(bte_ptr) != NULL))
  {
    delete_attrib(CUBIT_TRUE);
  }
  else if( (bte_ptr->bridge_manager()->number_of_bridges() == 1) &&
           (bte_ptr->bridge_manager()->topology_bridge()->bridge_sense() != CUBIT_REVERSED) )
  {
    delete_attrib(CUBIT_TRUE);
  }
  else
  {
      // get the merge id from the TDUniqueId for the owner entity
    mergeID = TDUniqueId::get_unique_id(attribOwnerEntity);
    bridge_sense_ = CUBIT_UNKNOWN;
    isSurvivor = 0;
  }

  return CUBIT_SUCCESS;
}
Пример #2
0
CubitStatus CABodies::update()
{
  if (hasUpdated) return CUBIT_SUCCESS;
  
  if (DEBUG_FLAG(138))
  {
    PRINT_DEBUG_138( "Updating BODIES attribute for %s %d\n",
              attribOwnerEntity->class_name(), attribOwnerEntity->id());
  }

  // set the updated flag
  hasUpdated = CUBIT_TRUE;
  
  // if the owner has a body list, save it, otherwise delete this one
  TDParallel *td_par = (TDParallel *) attrib_owner()->get_TD(&TDParallel::is_parallel);
  
  if (td_par == NULL) {
    delete_attrib(CUBIT_TRUE);
  }
  else {
    m_interface = td_par->is_interface();
    m_uniqueID = td_par->get_unique_id();
    int size = td_par->get_shared_body_list()->size();
    td_par->get_shared_body_list()->reset();
    m_sharedBodies.clean_out();

    for (int i = 0; i < size; i++) {
      m_sharedBodies.append(td_par->get_shared_body_list()->get_and_step());
    }

    size = td_par->get_shared_proc_list()->size();
    td_par->get_shared_proc_list()->reset();
    m_sharedProcs.clean_out();

    for (int i = 0; i < size; i++) {
      m_sharedProcs.append(td_par->get_shared_proc_list()->get_and_step());
    }

    size = td_par->get_ghost_proc_list()->size();
    td_par->get_ghost_proc_list()->reset();
    m_ghostProcs.clean_out();

    for (int i = 0; i < size; i++) {
      m_ghostProcs.append(td_par->get_ghost_proc_list()->get_and_step());
    }
	
    if (delete_attrib() == CUBIT_TRUE) delete_attrib(CUBIT_FALSE);
  }

  return CUBIT_SUCCESS;
}
Пример #3
0
CubitStatus CAUniqueId::actuate()
{

  if (hasActuated == CUBIT_TRUE) return CUBIT_SUCCESS;

    // create a TDUniqueId for the entity, if it doesn't already
    // exist
  TDUniqueId *uid = (TDUniqueId *) attrib_owner()->get_TD(&TDUniqueId::is_unique_id);

  if (uid != NULL) {
      // check to make sure it's the same unique id
    if (uid->unique_id() != uniqueId) {
      PRINT_ERROR("Different unique id found for %s %d.\n",
                  attrib_owner()->class_name(), attrib_owner()->id());
      return CUBIT_FAILURE;
    }
  }
  else {
      // else make a new one
    uid = new TDUniqueId(attrib_owner(), uniqueId);
  }
  
  delete_attrib(CUBIT_TRUE);
  hasActuated = CUBIT_TRUE;
  
  return CUBIT_SUCCESS;
}
Пример #4
0
CubitStatus CAEntityTol::update()
{
  //delete_attrib(CUBIT_TRUE);
  //return CUBIT_SUCCESS;

  if (hasUpdated) return CUBIT_SUCCESS;
  
  PRINT_DEBUG_95( "Updating ENTITY_TOL attribute for %s %d\n",
              attribOwnerEntity->class_name(), attribOwnerEntity->id());

    // set the updated flag
  hasUpdated = CUBIT_TRUE;

    // first, remove this attrib in its old form from the geometry entity
  if (hasWritten == CUBIT_TRUE) 
  {
    attribOwnerEntity->remove_attrib_geometry_entity(this);
    hasWritten = CUBIT_FALSE;
  }
  
  double local_tol = attribOwnerEntity->local_tolerance();
  if( local_tol == 0.0)
  {
    delete_attrib(CUBIT_TRUE);
    return CUBIT_SUCCESS;
  }
  else
  {
         
    // reset the delete flag if it was set before
    delete_attrib(CUBIT_FALSE);
    
      // now, write to geometry entity
    entityTol = local_tol;
    attribOwnerEntity->write_specific_cubit_attrib(this);
  }
  return CUBIT_SUCCESS;
}
Пример #5
0
CubitStatus CAUniqueId::update()
{
  if (hasUpdated) return CUBIT_SUCCESS;
  
    // set the updated flag
  hasUpdated = CUBIT_TRUE;

    // if the owner has a unique id, save it, otherwise delete this one
  TDUniqueId *td_uid = (TDUniqueId *) attrib_owner()->get_TD(&TDUniqueId::is_unique_id);

  if (NULL == td_uid && autoUniqueId) 
    td_uid = new TDUniqueId(attrib_owner());

  if (td_uid == NULL) {
    delete_attrib(CUBIT_TRUE);
  }

  else {
    uniqueId = td_uid->unique_id();
    if (delete_attrib() == CUBIT_TRUE) delete_attrib(CUBIT_FALSE);
  }
  
  return CUBIT_SUCCESS;
}
Пример #6
0
CubitStatus CAVirtualVG::update()
{

    // the owner entity is virtual; put a CAVirtualVG on the underlying entity to represent
    // this entity

  if (hasUpdated) return CUBIT_SUCCESS;
/*  
  assert(attrib_owner() != 0);

  TopologyEntity *topo_entity = CAST_TO(attrib_owner(), TopologyEntity);
  assert(topo_entity != 0);
  
  DLIList<VirtualEntity*> ve_list;
  VirtualGeometryEngine::instance()->get_VEs(topo_entity, ve_list, CUBIT_FALSE, CUBIT_FALSE);
  
  for( int i = ve_list.size(); i--; )
  {
    ParasiteEntity *vge = dynamic_cast<ParasiteEntity*>(ve_list.get_and_step());

  if (vge == NULL) {
      // this entity isn't a virtual entity - if this entity doesn't have any virtual
      // entities registered, set delete flag, then exit
    if (numVV == 0 && numVC == 0)
      delete_attrib(CUBIT_TRUE);
    else {
      PRINT_DEBUG_90("Keeping CA_VIRTUAL_VG for %s %d\n",
                     attrib_owner()->class_name(), attrib_owner()->id());
      hasUpdated = CUBIT_TRUE;
    }
    
    continue;
  }

    // ok, we have a virtual entity; first get the underlying entity, and a CAVVG for that
    // entity
  BasicTopologyEntity* bte_ptr = vge->bte_bound_to();
  
  if (!bte_ptr) {
    PRINT_ERROR("Couldn't find underlying BTE for virtual entity %s %d.\n",
                attrib_owner()->class_name(), attrib_owner()->id());
    return CUBIT_FAILURE;
  }
  
  CAVirtualVG *other_CAVVG = (CAVirtualVG *) bte_ptr->get_cubit_attrib(CA_VIRTUAL_VG);

    // if that other CAPVG's written flag is set, it's an old one from a
    // previous write and needs to be reset
  if (other_CAVVG->has_written() == CUBIT_TRUE) {
    other_CAVVG->reset();
    other_CAVVG->has_written(CUBIT_FALSE);
  }

    // now put virtual geometry-specific data on the attribute
  ParasitePoint *vvertex = CAST_TO(vge, ParasitePoint);
  ParasiteCurve *vcurve = CAST_TO(vge, ParasiteCurve);
  if (vvertex != NULL) {
      // put uids and position on ca
    other_CAVVG->add_vvertex(vvertex);
    other_CAVVG->delete_attrib(CUBIT_FALSE);
  }

  else if (vcurve != NULL) {
    other_CAVVG->add_vcurve(vcurve);
    other_CAVVG->delete_attrib(CUBIT_FALSE);
  }

  else {
    PRINT_ERROR("Shouldn't get here in CAVirtualVG::update.\n");
    return CUBIT_FAILURE;
  }
  }

  hasUpdated = CUBIT_TRUE;
  if (numVV == 0 && numVV == 0) delete_attrib(CUBIT_TRUE);
  
  return CUBIT_SUCCESS;
*/ 

  delete_attrib(CUBIT_TRUE);
  return CUBIT_SUCCESS;
}
Пример #7
0
CubitStatus CABodies::actuate()
{
  CubitStatus status = CUBIT_SUCCESS;

  if (hasActuated == CUBIT_TRUE) return CUBIT_SUCCESS;

  if (DEBUG_FLAG(138))
  {
    PRINT_DEBUG_138( "Actuating BODIES attribute for %s %d\n",
		     attribOwnerEntity->class_name(), attribOwnerEntity->id());
  }

  // create a TDParallel for the entity, if it doesn't already exist
  TDParallel *par = (TDParallel *) attrib_owner()->get_TD(&TDParallel::is_parallel);

  if (par != NULL) {
    if (par->is_interface() != m_interface) {
      PRINT_ERROR("TDParallel interface check is failed for %s %d.\n",
		  attrib_owner()->class_name(), attrib_owner()->id());
      return CUBIT_FAILURE;
    }

    // check to make sure it's the same body list
    par->get_shared_body_list()->reset();
    m_sharedBodies.reset();
    int size = par->get_shared_body_list()->size();

    for (int i = 0; i < size; i++) {
      if (par->get_shared_body_list()->get_and_step() != m_sharedBodies.get_and_step()) {
	PRINT_ERROR("Different body found for %s %d.\n",
		    attrib_owner()->class_name(), attrib_owner()->id());
	return CUBIT_FAILURE;
      }
    }

    par->get_shared_proc_list()->reset();
    m_sharedProcs.reset();
    size = par->get_shared_proc_list()->size();

    for (int i = 0; i < size; i++) {
      if (par->get_shared_proc_list()->get_and_step() != m_sharedProcs.get_and_step()) {
	PRINT_ERROR("Different processor found for %s %d.\n",
		    attrib_owner()->class_name(), attrib_owner()->id());
	return CUBIT_FAILURE;
      }
    }

    par->get_ghost_proc_list()->reset();
    m_ghostProcs.reset();
    size = par->get_ghost_proc_list()->size();

    for (int i = 0; i < size; i++) {
      if (par->get_ghost_proc_list()->get_and_step() != m_ghostProcs.get_and_step()) {
	PRINT_ERROR("Different ghost processor found for %s %d.\n",
		    attrib_owner()->class_name(), attrib_owner()->id());
	return CUBIT_FAILURE;
      }
    }

    if ((int)par->get_unique_id() != m_uniqueID) {
      PRINT_ERROR("Different unique ID found for %s %d.\n",
		  attrib_owner()->class_name(), attrib_owner()->id());
      return CUBIT_FAILURE;
    }
  }
  else {
    // else make a new one
    par = new TDParallel(attrib_owner(), &m_sharedBodies, &m_sharedProcs,
			 &m_ghostProcs, m_uniqueID, m_interface);
  }

  delete_attrib(CUBIT_TRUE);
  hasActuated = CUBIT_TRUE;

  return status;
}