swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: b8dc9c592d744c40cc371cb5d3aa36a336ba1379 authored by Wenqing Wang on 24 February 2021, 16:13:27 UTC
[TM] Fixed the integration order for IP data I/O
Tip revision: b8dc9c5
Component.cpp
/**
 * \file
 * \author Norbert Grunwald
 * \date   Sep 7, 2017
 *
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#include "Component.h"
#include "Components/Components.h"
#include "Properties/Properties.h"

namespace MaterialPropertyLib
{
Component::Component()
{
}

Component::Component(std::string const& component_name,
                     std::unique_ptr<PropertyArray>&& properties)
    : name(component_name)
{
    if (properties)
    {
        overwriteExistingProperties(properties_, *properties, this);
    }
}

Property const& Component::property(PropertyType const& p) const
{
    return *properties_[p];
}

bool Component::hasProperty(PropertyType const& p) const
{
    return properties_[p] != nullptr;
}

std::string Component::description() const
{
    return "component '" + name + "'";
}
}  // namespace MaterialPropertyLib
back to top