433template <
typename PropertyT, PropertyType propertyType,
typename spaceType,
typename VariadicTemplateTypesHolder>
472struct ReceiverFor:
public Receiver<ProviderImpl<PropertyT, PropertyT::propertyType, SpaceT, typename PropertyT::ExtraParams>> {
497 template <
typename...
Args,
PropertyType propertyType = PropertyTag::propertyType>
498 typename std::enable_if<propertyType == SINGLE_VALUE_PROPERTY>::type
507 template <
typename...
Args,
PropertyType propertyType = PropertyTag::propertyType>
508 typename std::enable_if<propertyType == MULTI_VALUE_PROPERTY>::type
517 template <
typename...
Args,
PropertyType propertyType = PropertyTag::propertyType>
518 typename std::enable_if<propertyType == MULTI_VALUE_PROPERTY>::type
528 template <
typename MeshT, PropertyType propertyType = PropertyTag::propertyType>
529 typename std::enable_if<propertyType == FIELD_PROPERTY || propertyType == MULTI_FIELD_PROPERTY>::type
531 if (data.size() != mesh->size())
532 throw BadMesh(
"receiverFor::setValues()",
"Mesh size ({1}) and data size ({0}) do not match", data.size(), mesh->size());
540 template <
typename Iterator, PropertyType propertyType = PropertyTag::propertyType>
541 typename std::enable_if<propertyType == MULTI_FIELD_PROPERTY>::type
551 template <
typename MeshT,
typename Iterator, PropertyType propertyType = PropertyTag::propertyType>
552 typename std::enable_if<propertyType == MULTI_FIELD_PROPERTY>::type
553 setValues(Iterator begin, Iterator end, shared_ptr<MeshT> mesh) {
555 for (Iterator
it = begin;
it != end; ++
it, ++i )
556 if (*
it.size() != mesh->size())
557 throw BadMesh(
"receiverFor::setValues()",
"Mesh size ({1}) and data[{2}] size ({0}) do not match",
it->size(), mesh->size(), i);
566 template <
typename MeshT, PropertyType propertyType = PropertyTag::propertyType>
567 typename std::enable_if<propertyType == MULTI_FIELD_PROPERTY>::type
569 for (
auto it = data.begin();
it != data.end(); ++
it)
570 if (
it->size() != mesh->size())
571 throw BadMesh(
"receiverFor::setValues()",
"Mesh size ({1}) and data[{2}] size ({0}) do not match",
it->size(), mesh->size(),
it-data.begin());
578 template <
typename GeometryT = SpaceT>
579 typename std::enable_if<std::is_same<GeometryT, Geometry3D>::value>::type
587 template <
typename GeometryT = SpaceT>
588 typename std::enable_if<std::is_same<GeometryT, Geometry3D>::value>::type
596 template <
typename GeometryT = SpaceT>
597 typename std::enable_if<std::is_same<GeometryT, Geometry2DCartesian>::value>::type
605 template <
typename GeometryT = SpaceT>
606 typename std::enable_if<std::is_same<GeometryT, Geometry2DCylindrical>::value>::type
614 template <PropertyType propertyType = PropertyTag::propertyType>
615 typename std::enable_if<propertyType == MULTI_VALUE_PROPERTY || propertyType == MULTI_FIELD_PROPERTY, size_t>::type
622 "Receivers for fields properties require SpaceT. Use ReceiverFor<propertyTag, SpaceT>, where SpaceT is one of the classes defined in <plask/geometry/space.h>.");
624 "Receivers for single value properties doesn't need SpaceT. Use ReceiverFor<propertyTag> (without second template parameter).");