swh:1:snp:f521c49ab17ef7db6ec70b2430e1ed203f50383f
Raw File
Tip revision: 63005e54d906a953d24af54c168ff8af1e732124 authored by Dmitri Naumov on 04 March 2021, 08:52:46 UTC
[T/App/U] Add GMSH2OGS snakemake ctest.
Tip revision: 63005e5
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