Loading...
Searching...
No Matches
Variable.h
// Copyright (C) 2003-2009 Anders Logg
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// Modified by Garth N. Wells, 2011
//
// First added: 2003-02-26
// Last changed: 2011-09-24
#ifndef __VARIABLE_H
#define __VARIABLE_H
#include <cstddef>
#include <string>
#include <dolfin/parameter/Parameters.h>
namespace dolfin
{
class Variable
{
public:
Variable();
Variable(const std::string name, const std::string label);
Variable(const Variable& variable);
virtual ~Variable();
const Variable& operator=(const Variable& variable);
void rename(const std::string name, const std::string label);
std::string name() const;
std::string label() const;
std::size_t id() const { return unique_id; }
virtual std::string str(bool verbose) const;
Parameters parameters;
private:
// Name
std::string _name;
// Label
std::string _label;
// Unique identifier
const std::size_t unique_id;
};
}
#endif
dolfin::Parameters
Definition Parameters.h:95
dolfin::Variable::parameters
Parameters parameters
Parameters.
Definition Variable.h:74
dolfin::Variable::label
std::string label() const
Return label (description).
Definition Variable.cpp:76
dolfin::Variable::name
std::string name() const
Return name.
Definition Variable.cpp:71
dolfin::Variable::str
virtual std::string str(bool verbose) const
Return informal string representation (pretty-print).
Definition Variable.cpp:81
dolfin::Variable::operator=
const Variable & operator=(const Variable &variable)
Assignment operator.
Definition Variable.cpp:55
dolfin::Variable::Variable
Variable()
Create unnamed variable.
Definition Variable.cpp:31
dolfin::Variable::rename
void rename(const std::string name, const std::string label)
Rename variable.
Definition Variable.cpp:65
dolfin::Variable::id
std::size_t id() const
Definition Variable.h:68
dolfin::Variable::~Variable
virtual ~Variable()
Destructor.
Definition Variable.cpp:50
dolfin
Definition adapt.h:30