framework icon indicating copy to clipboard operation
framework copied to clipboard

Get the environment id for a MatVarIndex

Open DavidDureau opened this issue 2 years ago • 4 comments

In a accelerator loop, we would like to get the environment id for a given MatVarIndex:

CellToAllEnvCellAcessor c2ae(....);

command << RUNCOMMAND_ENUMERATE_CELL_ALLENVCELL(c2ae, cid, cell_group)
{
  ENUMERATE_CELL_ALLENVCELL(iev, cid, c2ae) {
    Integer env_id = envId(*iev);
    func(env_id);
  }
};

envId(MatVarIndex) could be a function, a method, or address an MaterialVariableCellInteger managed by Arcane ...

DavidDureau avatar Oct 10 '23 14:10 DavidDureau

I have looked at this problem. I will provide a workaround for it. I will make some methods of EnvCell and AllEnvCell available on accelerator. It may not be ideal in term of performance because there is a pointer indirection to access the information but it should work. I will do it last week of October.

grospelliergilles avatar Oct 11 '23 14:10 grospelliergilles

A preview is available in #925

grospelliergilles avatar Oct 11 '23 16:10 grospelliergilles

For performance reason, I would prefer a solution with light objects like MatVarIndex, CellLocalId and a MatItemVariableScalarInViewT<Cell,Integer>.

Would it be possible?

DavidDureau avatar Oct 12 '23 07:10 DavidDureau

Yes. #925 is a temporary solution.

grospelliergilles avatar Oct 12 '23 14:10 grospelliergilles