Exemplo n.º 1
0
bool IRefiner::coarsen()
{
	#ifdef UG_PARALLEL
		PCL_DEBUG_BARRIER_ALL();
	#endif
	PROFILE_BEGIN_GROUP(IRefiner_coarsen, "grid");
//	if coarsen isn't supported, we'll leave right away
	if(!coarsening_supported())
		return false;

	if(!m_messageHub.valid()){
		UG_THROW("A message-hub has to be assigned to IRefiner before coarsen may be called. "
				"Make sure that you assigned a grid to the refiner you're using.");
	}

//	we'll schedule an adaption-begins message, if adaption is not yet enabled.
	bool locallyActivatedAdaption = false;
	if(!m_adaptionIsActive){
		locallyActivatedAdaption = true;
		adaption_begins();
	}

//	now post a message, which informs that coarsening begins
//	if(adaptivity_supported())
//		m_messageHub->post_message(GridMessage_Adaption(GMAT_HNODE_COARSENING_BEGINS));
//	else
//		m_messageHub->post_message(GridMessage_Adaption(GMAT_GLOBAL_COARSENING_BEGINS));

//	now perform coarsening
	bool retVal = perform_coarsening();

//	post a message that coarsening has been finished
//	if(adaptivity_supported())
//		m_messageHub->post_message(GridMessage_Adaption(GMAT_HNODE_COARSENING_ENDS));
//	else
//		m_messageHub->post_message(GridMessage_Adaption(GMAT_GLOBAL_COARSENING_ENDS));

//	and finally - if we posted an adaption-begins message, then we'll post
//	an adaption ends message, too.
	if(locallyActivatedAdaption)
		adaption_ends();

//	done
	#ifdef UG_PARALLEL
		PCL_DEBUG_BARRIER_ALL();
	#endif
	return retVal;
}
Exemplo n.º 2
0
static void PclDebugBarrierAll()
{
	PCL_DEBUG_BARRIER_ALL();
}