DOLFIN-X
DOLFIN-X C++ interface
|
9 #include "FunctionSpace.h"
10 #include <Eigen/Dense>
11 #include <dolfinx/common/types.h>
12 #include <dolfinx/fem/FiniteElement.h>
13 #include <dolfinx/la/PETScVector.h>
46 explicit Function(std::shared_ptr<const FunctionSpace> V);
54 Function(std::shared_ptr<const FunctionSpace> V, Vec x);
101 interpolate(
const std::function<Eigen::Array<PetscScalar, Eigen::Dynamic,
102 Eigen::Dynamic, Eigen::RowMajor>(
103 const Eigen::Ref<
const Eigen::Array<
double, 3, Eigen::Dynamic,
104 Eigen::RowMajor>>&)>& f);
140 eval(
const Eigen::Ref<
141 const Eigen::Array<double, Eigen::Dynamic, 3, Eigen::RowMajor>>& x,
142 const Eigen::Ref<
const Eigen::Array<int, Eigen::Dynamic, 1>>& cells,
143 Eigen::Ref<Eigen::Array<PetscScalar, Eigen::Dynamic, Eigen::Dynamic,
149 Eigen::Array<PetscScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
156 std::size_t
id()
const;
163 std::shared_ptr<const FunctionSpace> _function_space;
Function(std::shared_ptr< const FunctionSpace > V)
Create function on given function space.
Definition: Function.cpp:64
int value_dimension(int i) const
Return value dimension for given axis.
Definition: Function.cpp:306
Eigen::Array< PetscScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > compute_point_values() const
Compute values at all mesh points.
Definition: Function.cpp:322
int value_size() const
Return value size.
Definition: Function.cpp:298
Function collapse() const
Collapse a subfunction (view into the Function) to a stand-alone Function.
Definition: Function.cpp:99
It is a simple wrapper for a PETSc vector pointer (Vec). Its main purpose is to assist memory managem...
Definition: PETScVector.h:31
std::string name
Name.
Definition: Function.h:153
void eval(const Eigen::Ref< const Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor >> &x, const Eigen::Ref< const Eigen::Array< int, Eigen::Dynamic, 1 >> &cells, Eigen::Ref< Eigen::Array< PetscScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor >> u) const
Evaluate the Function at points.
Definition: Function.cpp:149
Axis-Aligned bounding box binary tree. It is used to find entities in a collection (often a mesh::Mes...
Definition: BoundingBoxTree.h:30
int value_rank() const
Return value rank.
Definition: Function.cpp:291
Function & operator=(Function &&v)=default
Move assignment.
la::PETScVector & vector()
Return vector of expansion coefficients (non-const version)
Definition: Function.cpp:131
Function sub(int i) const
Extract subfunction (view into the Function)
Definition: Function.cpp:89
std::shared_ptr< const FunctionSpace > function_space() const
Return shared pointer to function space.
Definition: Function.cpp:126
std::size_t id() const
ID.
Definition: Function.cpp:375
This class represents a function in a finite element function space , given by.
Definition: Function.h:41
void interpolate_c(const FunctionSpace::interpolation_function &f)
Interpolate an expression. This interface uses an expression function f that has an in/out argument f...
Definition: Function.cpp:285
std::function< void(Eigen::Ref< Eigen::Array< PetscScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > >, const Eigen::Ref< const Eigen::Array< double, Eigen::Dynamic, 3, Eigen::RowMajor > > &)> interpolation_function
Interpolation function.
Definition: FunctionSpace.h:93
std::vector< int > value_shape() const
Return value shape.
Definition: Function.cpp:313
void interpolate(const Function &v)
Interpolate a Function (on possibly non-matching meshes)
Definition: Function.cpp:268
virtual ~Function()=default
Destructor.