https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12void
13dataStore(std::ostream & stream, PropertyValue & p, void *)
14{
15 p.store(stream);
16}
17
18void
19dataLoad(std::istream & stream, PropertyValue & p, void *)
20{
21 p.load(stream);
22}
23
24void
25dataStore(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
34void
35dataLoad(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 dataStore(std::ostream &stream, PropertyValue &p, void *)
void dataLoad(std::istream &stream, PropertyValue &p, void *)
Abstract definition of a property value.
virtual void store(std::ostream &stream)=0
virtual void load(std::istream &stream)=0
std::size_t size() const