Support #88

is there anything wrong with this code?

Added by Niyazi Cem Degirmenci over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:06/18/2013
Priority:HighDue date:
Assignee:Niyazi Cem Degirmenci% Done:

0%

Category:-
Target version:-

Description

Hello, I started getting error on the ~UFC destructor
when I switch to dolfin-hpc UFL branch

since otherwise SpaceTimeFunction was giving runtime error about element names

the code I suspect to be wrong is:
fscalarDG0 is a pointer to a form
iscalarDG0 is an integer
form and integer is used to point to a DG0 argument

382   {
383
384 int d = mesh.topology().dim();
385 int N = mesh.numVertices();
386 if(MPI::numProcesses() > 1)
387 N = mesh.distdata().global_numVertices();
388 int M = mesh.numCells();
389 if(MPI::numProcesses() > 1)
390 M = mesh.distdata().global_numCells();
391
392 {
393 UFC ufc(fscalarDG0->form(), mesh, fscalarDG0->dofMaps());
394 Cell c(mesh, 0);
395 uint local_dim = c.numEntities(0);
396 uint *idx = new uint[local_dim];
397 uint *id = new uint[local_dim];
398 real *rho_block = new real[local_dim];
399 real rho_val;
400
401 for (CellIterator cell(mesh); !cell.end(); +cell)
402 {
403 ufc.update(*cell, mesh.distdata());
404 (fscalarDG0->dofMaps())[iscalarDG0].tabulate_dofs(idx, ufc.cell, cell->index());
405
406 // Only one dof
407 uint ii = 0;
408 uint jj = 0;
409 if(solid_cells.get(*cell))
410 {
411 rho_val = solid_density;
412 }
413 else
414 rho_val = fluid_density;
415
416 rho_block[jj] = rho_val;
417 id[jj
+] = idx[ii];
418 rho.vector().set(rho_block, jj, id);
419 }
420
421 rho.vector().apply();
422
423 delete[] rho_block;
424 delete[] idx;
425 delete[] id;
426 }
427 }

History

#1 Updated by Niclas Jansson over 4 years ago

  • Tracker changed from Code review to Support

#2 Updated by Niyazi Cem Degirmenci over 4 years ago

  • Assignee changed from Niclas Jansson to Aurélien Larcher

#3 Updated by Aurélien Larcher over 4 years ago

  • Assignee changed from Aurélien Larcher to Niyazi Cem Degirmenci

Up. How did you solve the issue after our mail exchange ?

#4 Updated by Niyazi Cem Degirmenci over 4 years ago

  • Status changed from New to Closed

I needed to recompile dolfin to solve the problem

Also available in: Atom PDF