Example #1
0
OOPMReturnType OOPMergeMatrix::Execute()
{
	
	cout << "Executing Task " << Id() << " For Dispersed vector aggregation ";
	TPZMatrix<REAL> * GlobalVector = dynamic_cast<TPZMatrix<REAL> * > (fDependRequest.ObjectPtr(0));
	OOPParMatIndexation * Indices = NULL;
	Indices = dynamic_cast<OOPParMatIndexation * >  (fDependRequest.ObjectPtr(1));
	
#ifdef LOGPZ
	{
		if(!Indices)
		{
			std::stringstream sout;
			sout << "Indices Object not available";
			LOGPZ_ERROR(logger, sout.str().c_str());
		}
	}
#endif
	
	std::vector<int> rows = Indices->GetRowVector(m_SubId);
	
#ifdef LOGPZ
	{
		std::stringstream sout;
		sout << "Rows.size on MergeTask = " << rows.size();
		LOGPZ_ERROR(logger, sout.str().c_str());
	}
#endif
	int i;
#ifdef LOGPZ
	std::stringstream sout;
	for(i = 0; i < rows.size(); i++)
	{
		sout << "Row[" << i << "] = " << rows[i] << endl;
	}
	GlobalVector->Print("Global Vector Original", sout, EFormatted);
#endif
	for(i = 0; i < rows.size(); i++)
	{
		GlobalVector->Put(rows[i], 0, GlobalVector->Get(rows[i], 0) + m_Vector.Get(i, 0));
	}
	
	//IncrementWriteDependentData();
#ifdef LOGPZ
	{
		std::stringstream sout;
		sout << "Leaving Merge Task Id " << Id();
		sout << "\nResulting Vector\n";
		m_Vector.Print("Local Vector", sout, EFormatted);
		GlobalVector->Print("Global Vector After Contribution", sout, EFormatted);
		LOGPZ_DEBUG(logger, sout.str().c_str());
	}
#endif
	cout << "Leaving Merge Task execution " << endl;
	return ESuccess;
}
Example #2
0
void OOPDouble::Read(TPZStream & buf, void * context){
	TPZSaveable::Read(buf, context);
	buf.Read(&fValue);
	int clsid=0;
	buf.Read(&clsid);
	if(clsid!=ClassId()){
#ifdef LOG4CXX
		std::stringstream sout;
		sout << "ClassId missmatch on OOPDouble::Read";
		LOGPZ_ERROR(logger,sout.str().c_str());
#endif
	}
}
Example #3
0
inline void TPZCompElWithMem<TPZInterfaceElement>::PrepareIntPtIndices() {
    
    // This code was copied from TPZInterpolationSpace::CalcStiff with minor changes
    // regarding integration point index evaluation.
    // Inclusions were commented properly.
    
    if(fIntPtIndices.NElements())
    {
#ifdef LOG4CXX
        {
            std::stringstream sout;
            sout << __PRETTY_FUNCTION__ << " Attempting to add memory indices to an already configured TPZCompElWithMem";
            LOGPZ_ERROR(CompElWMemlogger,sout.str().c_str());
        }
#endif
        return;
    }
    
    TPZMaterial * material = TPZInterfaceElement::Material();
    if(!material){
        PZError << "Error at " << __PRETTY_FUNCTION__ << " this->Material() == NULL\n";
        return;
    }
    if (this->LeftElementSide().Element() == 0 || this->RightElementSide().Element() == 0) {
        return;
    }
    
    if (this->NumberOfCompElementsInsideThisCompEl() == 0) {
        // This is suposed to happen if in the constructor of a multiphysics element. The CompEl vector is only initialized after the autobuild
        return;
    }
    
    const TPZIntPoints &intrule = TPZInterfaceElement::GetIntegrationRule();
    
    
    int intrulepoints = intrule.NPoints();
    
    fIntPtIndices.Resize(intrulepoints);
    
    for(int int_ind = 0; int_ind < intrulepoints; ++int_ind){
        fIntPtIndices[int_ind] = this->Material()->PushMemItem();
        // Pushing a new entry in the material memory
    } //Loop over integratin points generating a reference vector of memory
    //entries in the related pzmatwithmem for further use.
    
}
Example #4
0
TPZIntelGen<TSHAPE>::TPZIntelGen(TPZCompMesh &mesh,
								 const TPZIntelGen<TSHAPE> &copy,
								 std::map<int,int> & gl2lcConMap,
								 std::map<int,int> & gl2lcElMap) :
TPZInterpolatedElement(mesh,copy,gl2lcElMap), fIntRule(copy.fIntRule)
{
	//   if (gl2lcElMap.find(copy.fIndex)!= gl2lcElMap.end())
	//   {
	//     std::stringstream sout;
	//     sout << "ERROR in : " << __PRETTY_FUNCTION__
	//         << " trying to clone an already cloned element index: " << copy.fIndex;
	//     LOGPZ_ERROR(logger, sout.str().c_str());
	//     DebugStop();
	//   }
	
	fPreferredOrder = copy.fPreferredOrder;
	int i;
	for(i=0;i<TSHAPE::NSides;i++)
	{
		int lcIdx = -1;
		int glIdx = copy.fConnectIndexes[i];
		if (gl2lcConMap.find(glIdx) != gl2lcConMap.end()) lcIdx = gl2lcConMap[glIdx];
		else
		{
			std::stringstream sout;
			sout << "ERROR in : " << __PRETTY_FUNCTION__
			<< " trying to clone the connect index: " << glIdx
			<< " wich is not in mapped connect indexes!";
			LOGPZ_ERROR(logger, sout.str().c_str());
			fConnectIndexes[i] = -1;
			return;
		}
		fConnectIndexes[i] = lcIdx;
	}
	//   gl2lcElMap[copy.fIndex] = this->Index();
}