Esempio n. 1
0
void SolverThread::stiffnessAssembly() 
{ 
    updateF0();
    
    FEMTetrahedronMesh::Tetrahedron * tetrahedra = m_mesh->tetrahedra();
	unsigned totalTetrahedra = m_mesh->numTetrahedra();
	for(unsigned k=0;k<totalTetrahedra;k++) {
		Matrix33F Re = tetrahedra[k].Re;
		Matrix33F ReT = Re; ReT.transpose();

		for (unsigned i = 0; i < 4; ++i) {
			for (unsigned j = 0; j < 4; ++j) {
				Matrix33F tmpKe = tetrahedra[k].Ke[i][j];
				if (j >= i) {
					//Based on pseudocode given in Fig. 10.12 on page 361
					Matrix33F tmp = (Re*tmpKe)*ReT; 
					Matrix33F tmpT = tmp; tmpT.transpose();
					
					m_K_row[ tetrahedra[k].indices[i] ][tetrahedra[k].indices[j]]+=(tmp);
					
					if (j > i) {
						m_K_row[ tetrahedra[k].indices[j] ][tetrahedra[k].indices[i]]+= tmpT;
					}
				}

			}		
		}  	
	}
}
Esempio n. 2
0
void MainInterface::initFuncBar()
{
    toplevel *top ;
    seconlevel_f3 *sec_f3;
    seconlevel_f4 *sec_f4;
    seconlevel_f5 *sec_f5;
    seconlevel_f6 *sec_f6;

    top = new toplevel(this);
    top->setHidden(true);
    connect(top ,SIGNAL(menu(bool)) ,this ,SLOT(menuShow(bool)));

    sec_f3 = new seconlevel_f3(this);
    sec_f3 ->setHidden(true);

    sec_f4 = new seconlevel_f4(this);
    sec_f4 ->setHidden(true);

    sec_f5 = new seconlevel_f5(this);
    sec_f5 ->setHidden(true);

    sec_f6 = new seconlevel_f6(this);
    sec_f6 ->setHidden(true);

    barmap.clear();
    barmap.insert(23 ,sec_f3);
    barmap.insert(24 ,sec_f4);
    barmap.insert(25 ,sec_f5);
    barmap.insert(26 ,sec_f6);
    barmap.insert(28 ,top);

    barui = barmap[28];

    barui->setHidden(false);
    ui->horizontalLayout->addWidget(barui);

    connect(this ,SIGNAL(barF0()) ,barui ,SLOT(F0()));
    connect(spark_info ,SIGNAL(boolChange()) ,this ,SLOT(updateF0()));

    emit barF0();
}