From: Roy S. <roy...@ic...> - 2018-06-20 20:06:54
|
On Wed, 20 Jun 2018, Derek Gaston wrote: > Right now I have exactly _one_ var group (which makes this even more > puzzling)... No kidding. How many variables in the group? > and I'm trying to just pull out the first dof from that group > using dof_indices(). I then do all the rest of my indexing off of > that first dof for all the other dofs in the group. You mean using dof_number()? DofMap::dof_indices() will at minimum return you all the dofs for a single variable. > Maybe there's a better way to be doing that? Is there a more > straightforward way to get the first dof in a var_group? No, but (if you're using dof_number()) it sounds like what you want is a dof_number_group() call instead. Then you can determine vg and vig *once* rather than in each dof_number() call. We could use the same thing in DofMap::_dof_indices and DofMap::old_dof_indices if it works well. > I think I wouldn't mind just storing a var_num->var_group vector > somewhere that every DofObject has access to. The variable numbers > are always contiguous starting from 0 so we should just be able to > index into it. The trouble is "has access to". I'd rather avoid adding another 8 bytes per node+elem if we can. Wait, I'm being stupid. We don't actually have to make a pointer to it a member variable! Every time we call dof_number() we're doing so with a DofMap in hand, so it would be easy to cache lookups there and then pass a DofMap * to the DofObject as an argument with which to access that cache. --- Roy |