Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default constructor for TagBoxArray class #4346

Open
pkufourier opened this issue Feb 24, 2025 · 1 comment
Open

Default constructor for TagBoxArray class #4346

pkufourier opened this issue Feb 24, 2025 · 1 comment

Comments

@pkufourier
Copy link

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?

@WeiqunZhang
Copy link
Member

TagBoxArray has its special purposes. If you want a short integer version of iMultiFab, you can use FabArray<BaseFab<T>>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants