Skip to content

Default constructor for TagBoxArray class #4346

@pkufourier

Description

@pkufourier

The mark of geometry, boundaries or different levels of grids usually need the tag arries. Although AMReX has provided the integer type MF,i.e. iMultiFab, the int type might be too long for only tagging. If a shorter type of MF can be used, such as the TagBoxArray, which use char type, the memory can be greatly saved, and it may also contribute to the efficiency.

However, when I try to use TagBoxArray like iMultiFab, such as declare a private data member:

amrex::Vector <amrex::TagBoxArray> cell_tag_mf;

The compiler complains as:

/usr/include/c++/13/bits/stl_construct.h:119:7: error: no matching function for call to ‘amrex::TagBoxArray::TagBoxArray()’
119 | ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So maybe the enable of default constructor is useful to meet my needs. I am wondering the reason TagBoxArray is not openned as IMF and MF is due to that, some general functions, like the FillBoudary, Parallel operation on TagBoxArray are not implemented? Even so, I don't think this is a big problem. We can use the iMF to treat the tags firstly in Parallel, then copy the values to TagBoxArray so that at runtime, the visiting of tagarrays can save time. Or do I have other options to use a char-type MF?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions