Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: John Peterson <peterson@cf...>  20061102 04:42:41

Oh by the way, do you need to compute the reaction values based on the solution at the _nodes_ or at the Gaussian quadrature points? J Travis Austin writes: > > Hi, > > I'm with a group at the University of Auckland hoping to convince everyone to have libmesh be the basis > for our new software. Currently we are focusing on reactiondiffusion problems so I have built a simple > reactiondiffusion code using libmesh that can run on multiple processors. However I think it could be > more efficient when solving the reaction part. We are currently using linear finite elements so DOFs > are only located at vertices of rectangles and hexs. > > I've got code (seen below) to solve the reaction part at every DOF. It uses the standard method of > looping over elements. The call to cubic.react solves the reaction problem, and in general, can be > expensive so I only want to do it once. > > Currently this approach has me solving reaction (by building up the src vector) multiple times since one > DOF shares many elements. I'd like to only loop over nodes but it appears to be that mesh.nodes_begin() > and mesh.nodes_end() provides a start and end for ALL of the nodes, not the local nodes. > > Does anyone have a solution for looping over all nodes on your local processor without using the following > elementbased loop? (I accept that I will solve this reaction problem twice at nodes sitting between processor > boundaries.) > > Travis Austin > > MeshBase::const_element_iterator elem_it = mesh.active_local_elements_begin(); > const MeshBase::const_element_iterator elem_end = mesh.active_local_elements_end(); > > for ( ; elem_it != elem_end; ++elem_it) > { > > const Elem* elem = *elem_it; > > dof_map.dof_indices (elem, dof_indices); > > assert (dof_indices.size() <= elem>n_nodes()); > > for (unsigned int i=0; i<dof_indices.size(); i++) > if ((dof_indices[i] >= src.first_local_index()) && > (dof_indices[i] < src.last_local_index())) > { > // Get local node point > const Point& ep = elem>point (i); > // Get current stimulus for point > const Real stim = Is1(dof_indices[i],ep,time); > // Set stimulus to be used in solving reaction problem > src.set(dof_indices[i],(cubic.react(soln(dof_indices[i]),dt,stim)/Cm)); > } > > } 