Skip to content
Snippets Groups Projects
Commit b8d3bc27 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

allow to specify a constant Neumann boundary function from the parameter file

[[Imported from SVN: r9278]]
parent 3bb03bf6
No related branches found
No related tags found
No related merge requests found
......@@ -81,18 +81,23 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o
}
/** \brief A constant vector-valued function, for simple Neumann boundary values */
struct NeumannFunction
: public Dune::VirtualFunction<FieldVector<double,dim>, FieldVector<double,3> >
{
NeumannFunction(double homotopyParameter)
: homotopyParameter_(homotopyParameter)
NeumannFunction(const FieldVector<double,3> values,
double homotopyParameter)
: values_(values),
homotopyParameter_(homotopyParameter)
{}
void evaluate(const FieldVector<double, dim>& x, FieldVector<double,3>& out) const {
out = 0;
out.axpy(homotopyParameter_, values_);
out[2] = -40*homotopyParameter_;
}
FieldVector<double,3> values_;
double homotopyParameter_;
};
......@@ -236,7 +241,8 @@ int main (int argc, char *argv[]) try
// ////////////////////////////////////////////////////////////
const ParameterTree& materialParameters = parameterSet.sub("materialParameters");
NeumannFunction neumannFunction(homotopyParameter);
NeumannFunction neumannFunction(parameterSet.get<FieldVector<double,3> >("neumannValues"),
homotopyParameter);
std::cout << "Material parameters:" << std::endl;
materialParameters.report();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment