Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#8 Display Material density (g/cm3)

open
nobody
5
2012-08-29
2012-08-29
SC
No

Here is a code snippet to add material density on the Model: Content tab, for example:
/////////////////////////////
/* sum atomic masses */
for (list=model->cores ; list ; list=g_slist_next(list))
{
core = list->data;
total_mass=total_mass+elements[core->atom_code].weight;
}
printf("# density= %8.4f g/cm^3\n", total_mass/model->volume/0.602214);
// Volume in Angstrom^3, mass in g/mol

/////////////////////////////////////////

Discussion