Phalanx: build MDField<const ScalarT> from Tag<ScalarT>
Created by: ibaned
In Albany, there are complex evaluators which construct their MDField
members from Tag
s that are passed in through the parameter list. Until now, MDField<ScalarT>
built from Tag<ScalarT>
was fine. In working on gahansen/Albany#34, I now have MDField<const ScalarT>
that I'd still like to build from a Tag<ScalarT>
. I tried
field(tag.name(), tag.dataLayout())
but dataLayout
returns a const reference to the layout and the field constructor expects an RCP of a non-const layout. I propose this function be added to FieldTag
and Tag<T>
:
Teuchos::RCP<PHX::DataLayout> dataLayoutRCP() { return m_data_layout; }
unless there is an easier way to do what I'm trying to do, which is also fine. @trilinos/phalanx @rppawlo