Skip to content
Snippets Groups Projects
Commit fbea4678 authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

Allow homotopies also for Neumann boundary data

[[Imported from SVN: r8074]]
parent 78959211
No related branches found
No related tags found
No related merge requests found
...@@ -84,11 +84,16 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o ...@@ -84,11 +84,16 @@ void dirichletValues(const FieldVector<double,dim>& in, FieldVector<double,3>& o
struct NeumannFunction struct NeumannFunction
: public Dune::VirtualFunction<FieldVector<double,dim>, FieldVector<double,3> > : public Dune::VirtualFunction<FieldVector<double,dim>, FieldVector<double,3> >
{ {
NeumannFunction(double homotopyParameter)
: homotopyParameter_(homotopyParameter)
{}
void evaluate(const FieldVector<double, dim>& x, FieldVector<double,3>& out) const { void evaluate(const FieldVector<double, dim>& x, FieldVector<double,3>& out) const {
out = 0; out = 0;
out[2] = 4; out[0] = -40*homotopyParameter_;
} }
double homotopyParameter_;
}; };
...@@ -209,13 +214,23 @@ int main (int argc, char *argv[]) try ...@@ -209,13 +214,23 @@ int main (int argc, char *argv[]) try
// x[idx].q is the identity, set by the default constructor // x[idx].q is the identity, set by the default constructor
} }
////////////////////////////////////////////////////////
// Main homotopy loop
////////////////////////////////////////////////////////
for (int i=0; i<numHomotopySteps; i++) {
double homotopyParameter = (i+1)*(1.0/numHomotopySteps);
std::cout << "Homotopy step: " << i << ", parameter: " << homotopyParameter << std::endl;
// //////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////
// Create an assembler for the energy functional // Create an assembler for the energy functional
// //////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////
const ParameterTree& materialParameters = parameterSet.sub("materialParameters"); const ParameterTree& materialParameters = parameterSet.sub("materialParameters");
NeumannFunction neumannFunction; NeumannFunction neumannFunction(homotopyParameter);
CosseratEnergyLocalStiffness<GridType::LeafGridView, CosseratEnergyLocalStiffness<GridType::LeafGridView,
typename P1Basis::LocalFiniteElement, typename P1Basis::LocalFiniteElement,
...@@ -245,15 +260,6 @@ int main (int argc, char *argv[]) try ...@@ -245,15 +260,6 @@ int main (int argc, char *argv[]) try
baseTolerance, baseTolerance,
instrumented); instrumented);
////////////////////////////////////////////////////////
// Main homotopy loop
////////////////////////////////////////////////////////
for (int i=0; i<numHomotopySteps; i++) {
double homotopyParameter = (i+1)*(1.0/numHomotopySteps);
std::cout << "Homotopy step: " << i << ", parameter: " << homotopyParameter << std::endl;
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Set Dirichlet values // Set Dirichlet values
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
......
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