113 :
115 _allocateInLattice([](BlockLattice<T,DESCRIPTOR>& block) {
116 if constexpr (concepts::LatticeDescriptor<DESCRIPTOR>) {
117 block.template getData<FIELD_TYPE>();
118 }
119 }),
120 _allocateInBlockD([](BlockD<T,DESCRIPTOR>& block) {
121 block.template getData<FIELD_TYPE>();
122 }),
123 _setPlaceholderExpr([](Cell<Expr,DESCRIPTOR>& cell, std::vector<Expr>& expr) {
124 if constexpr (concepts::LatticeDescriptor<DESCRIPTOR>) {
126 if constexpr (std::is_same_v<Expr, typename FieldD<Expr,DESCRIPTOR,typename FIELD_TYPE::field_t>::value_t>) {
128 for (unsigned iD=0; iD < placeholder.d; ++iD) {
129 placeholder[iD] = expr[iD];
130 }
131 cell.template setField<typename FIELD_TYPE::field_t>(placeholder);
132 } else {
133 throw std::runtime_error("Can not set placeholder for non-T types");
134 }
135 } else {
136 throw std::runtime_error("Can not set placeholder for non-FieldArray types");
137 }
138 }
139 }),
140 _getPlaceholderExpr([](Cell<Expr,DESCRIPTOR>& cell) {
141 std::vector<Expr> expressions;
142 if constexpr (concepts::LatticeDescriptor<DESCRIPTOR>) {
144 if constexpr (std::is_same_v<Expr, typename FieldD<Expr,DESCRIPTOR,typename FIELD_TYPE::field_t>::value_t>) {
146 placeholder = cell.template getFieldPointer<typename FIELD_TYPE::field_t>();
147 for (unsigned iD=0; iD < placeholder.d; ++iD) {
148 expressions.push_back(placeholder[iD]);
149 }
150 } else {
151 throw std::runtime_error("Can not get placeholder for non-T types");
152 }
153 } else {
154 throw std::runtime_error("Can not get placeholder for non-FieldArray types");
155 }
156 }
157 return expressions;
158 })
159 {
161 _dim = std::optional<unsigned>{DESCRIPTOR::template size<typename FIELD_TYPE::field_t>()};
162 }
163 }
std::string name()
Returns name of FIELD for human consumption.
constexpr bool isArray()
Helper to determine if FIELD contains FieldArray.
Vector< typename FIELD::template value_type< T >, DESCRIPTOR::template size< FIELD >() > FieldD
Vector storing a single field instance.