@@ -382,8 +382,8 @@ void ScientificDefaults<Child>::defaults_impl()
382382 {
383383 defaultAttribute (" timeOffset" , 0 .f )
384384 .withSetter (&Record::setTimeOffset)(wor);
385- auto const &keyInParent = asChild ().writable ().ownKeyWithinParent ;
386385
386+ auto const &keyInParent = asChild ().writable ().ownKeyWithinParent ;
387387 if (keyInParent == " position" || keyInParent == " positionOffset" )
388388 {
389389 defaultAttribute (
@@ -410,27 +410,37 @@ void ScientificDefaults<Child>::defaults_impl()
410410 else if constexpr (std::is_same_v<Child, RecordComponent>)
411411 {
412412 defaultAttribute (" unitSI" , 1.0 )
413- .withSetter (&RecordComponent::setUnitSI)(wor);
413+ .withSetter (&RecordComponent::setUnitSI)
414+ .withReader ()(wor);
414415 }
415416 else if constexpr (std::is_same_v<Child, MeshRecordComponent>)
416417 {
417- // position
418418 auto dimensionality = asChild ().getDimensionality ();
419- defaultAttribute (" position" , [&]() {
420- if (dimensionality < 100 )
421- {
422- return std::vector<double >(dimensionality, 0.5 );
423- }
424- else
425- {
426- return std::vector<double >{0.0 };
427- }
428- }).withSetter (&MeshRecordComponent::setPosition)(wor);
419+
420+ defaultAttribute (
421+ " position" ,
422+ [&]() {
423+ if (dimensionality < 100 )
424+ {
425+ return std::vector<double >(dimensionality, 0.5 );
426+ }
427+ else
428+ {
429+ return std::vector<double >{0.0 };
430+ }
431+ })
432+ .withSetter (&MeshRecordComponent::setPosition)
433+ .withReader (ensureFloatingVector ([this ](auto &&val) {
434+ this ->asChild ().setPosition (static_cast <decltype (val)>(val));
435+ }))(wor);
436+
429437 addParentDefaults<RecordComponent, write>();
430438 }
431439 else if constexpr (std::is_same_v<Child, PatchRecordComponent>)
432440 {
433- addParentDefaults<RecordComponent, write>();
441+ // We don't require unitSI for PatchRecordComponent
442+ //
443+ // addParentDefaults<RecordComponent, write>();
434444 }
435445 else if constexpr (auxiliary::IsTemplateBaseOf_v<BaseRecord, Child>)
436446 {
0 commit comments