Loading...
Searching...
No Matches
Lagrange.h
// Copyright (C) 2003-2005 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/>.
//
// First added: 2003-06-12
// Last changed: 2009-09-08
#ifndef __LAGRANGE_H
#define __LAGRANGE_H
#include <vector>
#include <dolfin/log/Event.h>
#include <dolfin/common/Variable.h>
namespace dolfin
{
class Lagrange : public Variable
{
public:
Lagrange(std::size_t q);
Lagrange(const Lagrange& p);
void set(std::size_t i, double x);
std::size_t size() const;
std::size_t degree() const;
double point(std::size_t i) const;
double operator() (std::size_t i, double x);
double eval(std::size_t i, double x);
double ddx(std::size_t i, double x);
double dqdx(std::size_t i);
std::string str(bool verbose) const;
private:
void init();
const std::size_t _q;
// Counts the number of time set has been called to determine when
// init should be called
std::size_t counter;
std::vector<double> points;
std::vector<double> constants;
Event instability_detected;
};
}
#endif
dolfin::Event
Definition Event.h:47
dolfin::Lagrange::set
void set(std::size_t i, double x)
Definition Lagrange.cpp:44
dolfin::Lagrange::eval
double eval(std::size_t i, double x)
Definition Lagrange.cpp:76
dolfin::Lagrange::dqdx
double dqdx(std::size_t i)
Definition Lagrange.cpp:119
dolfin::Lagrange::Lagrange
Lagrange(std::size_t q)
Constructor.
Definition Lagrange.cpp:31
dolfin::Lagrange::degree
std::size_t degree() const
Definition Lagrange.cpp:60
dolfin::Lagrange::point
double point(std::size_t i) const
Definition Lagrange.cpp:65
dolfin::Lagrange::ddx
double ddx(std::size_t i, double x)
Definition Lagrange.cpp:90
dolfin::Lagrange::str
std::string str(bool verbose) const
Definition Lagrange.cpp:128
dolfin::Lagrange::size
std::size_t size() const
Definition Lagrange.cpp:55
dolfin::Lagrange::operator()
double operator()(std::size_t i, double x)
Definition Lagrange.cpp:71
dolfin::Variable::Variable
Variable()
Create unnamed variable.
Definition Variable.cpp:31
dolfin
Definition adapt.h:30