Exemplo n.º 1
0
void Galerkin::compute(double dt)
{
    clDMatrix diagU(uSol);
    clDMatrix diagV(vSol);
    clDMatrix diagW(wSol);
    clMatrix conv(numNodes,numVerts);

// cria matrix de conveccao u*nabla
    conv = (diagU * gx) + (diagV * gy) + (diagW * gz);

// copia somente as velocidades dos vertices
    clVector uVert(numVerts);
    clVector vVert(numVerts);
    clVector wVert(numVerts);
    clVector cVert(numVerts);
    uSol.CopyTo(0,uVert);
    vSol.CopyTo(0,vVert);
    wSol.CopyTo(0,wVert);
    cSol.CopyTo(0,cVert);

    convU = (-1)*conv * uVert;
    convV = (-1)*conv * vVert;
    convW = (-1)*conv * wVert;
    convC = (-1)*conv * cVert;

// condicao de contorno
    convU = convU.MultVec(*outflow);
    convV = convV.MultVec(*outflow);
    convW = convW.MultVec(*outflow);
//convC = convC.MultVec(*outflow);

} // fecha metodo compute
Exemplo n.º 2
0
	void GLQuadRenderer::computeAABB(Vector3D& AABBMin,Vector3D& AABBMax,const Group& group,const DataSet* dataSet) const
	{
		float diagonal = group.getGraphicalRadius() * std::sqrt(scaleX * scaleX + scaleY * scaleY);
		Vector3D diagV(diagonal,diagonal,diagonal);

		if (group.isEnabled(PARAM_SCALE))
			for (ConstGroupIterator particleIt(group); !particleIt.end(); ++particleIt)
			{
				Vector3D scaledDiagV = diagV * particleIt->getParamNC(PARAM_SCALE);
				AABBMin.setMin(particleIt->position() - scaledDiagV);
				AABBMax.setMax(particleIt->position() + scaledDiagV);
			}
		else
		{
			for (ConstGroupIterator particleIt(group); !particleIt.end(); ++particleIt)
			{
				AABBMin.setMin(particleIt->position());
				AABBMax.setMax(particleIt->position());
			}
			AABBMin -= diagV;
			AABBMax += diagV;
		}
	}