예제 #1
0
	constexpr void solve() {
		m_Matrix.fill(0.0f);
		m_Solution.fill(0.0f);
		m_P.fill(0.0f);

		for(size_t i = 0; i < ElementCount; ++i) {
			MeshElement &e = m_Problem.m_Elements[i];
			MeshNode &n1 = m_Problem.m_Nodes[e.m_Node1];
			MeshNode &n2 = m_Problem.m_Nodes[e.m_Node2];
			int p1 = e.m_Node1;
			int p2 = e.m_Node2;
		
			float dist = n1.Distance(n2);
			
			float C = vk * vS / dist;	
			if(n1.m_BoundaryIndex < Problem_t::BoundaryCount)
				ProcessBoundary(p1, &n1);
			if(n2.m_BoundaryIndex < Problem_t::BoundaryCount)
				ProcessBoundary(p2, &n2);				
			
			AddToGlobal(p1, p2, C);
			
		}
		
		m_Matrix.Invert(m_Inverted);
		MultiplyMatrices(m_Inverted, m_P, m_Solution);
	}	
예제 #2
0
파일: stats_queue.cpp 프로젝트: LXiong/ccn
STAT_QueueStatistics::STAT_QueueStatistics(Node* node,
    std::string queuePosition,
    int interfaceIndex,
    std::string queueType,
    int queueSize,
    int queueIndex,
    clocktype timeOfCreation)
{  
    m_Node = node;
    m_QueuePosition = queuePosition;
    m_InterfaceIndex = interfaceIndex;
    m_QueueSize = queueSize;
    m_QueueType = queueType;
    m_QueueIndex = queueIndex;
    m_lastChange = 0;
    m_creationTime = timeOfCreation;

    SetStatNames();
    AddToGlobal(&node->partitionData->stats->global.queueAggregate);
    m_AverageQueueLength.SetLastChange(timeOfCreation);
}