Ejemplo n.º 1
0
void
cool_func()
{
    struct gas_particle *gp ;
    int i ;

    if (!cool_loaded ){
	load_cool() ;
    }
    if (!uv_loaded ){
	load_uv() ;
    }
    if(cooling != NULL) free(cooling);
    if(boxlist[active_box].ngas != 0) {
	cooling = (double *)malloc(boxlist[0].ngas *sizeof(*cooling));
	if(cooling == NULL) {
	    printf("<sorry, no memory for cooling, %s>\n",title) ;
	    return ;
	}
    }
    else
      cooling = NULL;

    for (i = 0 ;i < boxlist[0].ngas ;i++) {
	gp = boxlist[0].gp[i] ;
	if(!uniform){
	    calc_uv(gp) ;
	}
	cooling[i] = heatcool(gp);
    }
    cooling_loaded = YES ;
}
Ejemplo n.º 2
0
/** 
 * import umdraw mesh list
 */
bool UMSoftwareIO::import_mesh_list(UMMeshList& dst, const umio::UMObjectPtr src, const umstring& absolute_file_path)
{
	if (!src) return false;

	bool result = false;
	umio::UMMesh::IDToMeshMap::iterator it = src->mutable_mesh_map().begin();
	for (; it != src->mutable_mesh_map().end(); ++it)
	{
		umio::UMMesh& ummesh = it->second;

		UMMeshPtr mesh(std::make_shared<UMMesh>());
		dst.push_back(mesh);
		result = true;
		
		sort_by_material(ummesh);
		load_material(absolute_file_path, mesh, ummesh);
		load_vertex_index(mesh, ummesh);
		load_vertex(mesh, ummesh);
		load_normal(mesh, ummesh);
		load_uv(mesh, ummesh);
		load_skin(mesh, ummesh);
		mesh->update_box();
	}
	return result;
}