Boost logo

Ublas :

Subject: Re: [ublas] FE assembly : a huge time time difference
From: Riccardo Rossi (rrossi_at_[hidden])
Date: 2011-01-03 05:37:25

      i have no experience with Ansys, however ublas CSR is reasonably
fast at FE assembly, provided that you preallocate the structure of the

if you like to see how we do it follow this link:

ConstructMatrixStructure fills in the zero structure of the matrix
(ccNUMA aware approach)

Build performs the actual assembly (openMP parallel)

hope this can help


Riccardo Rossi, Ph.D, Civil Engineer
member of the Kratos Group:
Centro Internacional de Métodos Numéricos en Ingeniería (CIMNE)
Universidad Politécnica de Cataluña (UPC)
Edificio C-1, campus Norte UPC
Gran Capitan, s/n
08034 Barcelona, España
Tel. (+34) 93 401 73 99
Los datos de carácter personal contenidos en el mensaje, se registrarán
en un fichero para facilitar la gestión de las comunicaciones de CIMNE.
Se pueden ejercitar los derechos de acceso, rectificación, cancelación y
oposición por escrito, dirigiéndose a nuestras oficinas de CIMNE, Gran
Capitán s/n,  Edificio C1 - Campus Norte UPC, 08034 Barcelona, España.
Les dades de caràcter personal contingudes en aquest missatge es
registraran en un fitxer per facilitar la gestió de les comunicacions
del CIMNE. Es poden exercir els drets d'accés, rectificació,
cancel·lació i oposició, per escrit a les nostres oficines del CIMNE,
Gran Capità s/n, Edifici C1, Campus Nord UPC, 08034 Barcelona, Espanya.
All personal data contained in this mail will be processed
confidentially and stored in a file property of CIMNE in order to manage
corporate communications. You may exercise the right of access,
rectification, deletion and objection by letter sent to CIMNE, Gran
Capitán, Edificio C1 - Campus Norte UPC, 08034 Barcelona, Spain.
On Thu, 2010-12-30 at 02:15 +0100, Umut Tabak wrote:
> Dear all,
> I was trying to read some system matrices from the commercial code ANSYS 
> to boost compressed_matrices (I saw the links of Gunther Winkler however 
> did not have the time to try yet), but the qu00007add-0000t is the 
> fastest way to assemble in FE sense,
> In pseudo code notation, ke is the element matrix
> K(dofs, dofs) = K(dofs, dofs) + ke
> So some technical detail that might help, ANSYS stores the symmetric 
> element matrices such as the ones result from structural elements in 
> lower triangular format
> I did some coding like below, as a first try however seems slow, and 
> thought that there should be a faster way to do this.
> Should I use indirect_array to assign the submatrices of element 
> contributions or what should be the right way to do this?
> Any pointers are appreciated.
> Best wishes,
> Umut
>     unsigned r=0, sI = 0; // row, and startIndex
>                           // for the lower triangular format
>     // read the dofs to assign
>     //dofIndxTable : dofs vector
>     // vals the lower triangular matrix in col oriented order
>     // reason why I use the slices here
>     for( std::vector<int>::const_iterator rowIter = dofIndxTable.begin();
>          rowIter != dofIndxTable.end(); ++rowIter 
> ){                                                                                         
>         vector_slice<vector <double> > vs( valsK, slice( sI, 1, r+1) );
>         unsigned clSz = vs.size();
>         unsigned c = 0;
>         for( std::vector<int>::const_iterator colIter = 
> dofIndxTable.begin();
>        (colIter != dofIndxTable.end() & c!=clSz); ++colIter ){
>           if ( r == c)
>               K( *rowIter-1, *colIter-1 ) += vs(c);
>           else{ 
>               K( *rowIter-1, *colIter-1 ) += vs(c);
>               K( *colIter-1, *rowIter-1 ) += vs(c);
>           }     
>           ++c;  
>         }     
>         sI += vs.size();
>         ++r;  
>     }
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> Sent to: rrossi_at_[hidden]