https://mooseframework.inl.gov
MaterialProperty.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "MaterialProperty.h"
11 
12 void
13 dataStore(std::ostream & stream, PropertyValue & p, void *)
14 {
15  p.store(stream);
16 }
17 
18 void
19 dataLoad(std::istream & stream, PropertyValue & p, void *)
20 {
21  p.load(stream);
22 }
23 
24 void
25 dataStore(std::ostream & stream, MaterialProperties & v, void * context)
26 {
27  std::size_t prop_size = v.size();
28  dataStore(stream, prop_size, context);
29 
30  for (const auto i : index_range(v))
31  dataStore(stream, v[i], context);
32 }
33 
34 void
35 dataLoad(std::istream & stream, MaterialProperties & v, void * context)
36 {
37  std::size_t prop_size;
38  dataLoad(stream, prop_size, context);
39  mooseAssert(prop_size == v.size(), "Loading MaterialProperties data into mis-sized target");
40 
41  for (const auto i : make_range(prop_size))
42  dataLoad(stream, v[i], context);
43 }
void dataLoad(std::istream &stream, PropertyValue &p, void *)
std::size_t size() const
Abstract definition of a property value.
virtual void store(std::ostream &stream)=0
void dataStore(std::ostream &stream, PropertyValue &p, void *)
IntRange< T > make_range(T beg, T end)
virtual void load(std::istream &stream)=0
auto index_range(const T &sizable)