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

Allow to switch between Harmonic energy and Skyrmion energy from the parameter file

[[Imported from SVN: r10013]]
parent d1cf578b
Branches
No related tags found
No related merge requests found
......@@ -185,13 +185,27 @@ int main (int argc, char *argv[]) try
// Create an assembler for the Harmonic Energy Functional
// ////////////////////////////////////////////////////////////
GFE::ChiralSkyrmionEnergy<GridType::LeafGridView, FEBasis::LocalFiniteElement, double> chiralSkyrmionEnergy;
// Assembler using ADOL-C
typedef TargetSpace::rebind<adouble>::other ATargetSpace;
HarmonicEnergyLocalStiffness<GridType::LeafGridView, FEBasis::LocalFiniteElement, ATargetSpace> harmonicEnergyADOLCLocalStiffness;
std::shared_ptr<LocalGeodesicFEStiffness<GridType::LeafGridView,FEBasis::LocalFiniteElement,ATargetSpace> > localEnergy;
std::string energy = parameterSet.get<std::string>("energy");
if (energy == "harmonic")
{
localEnergy.reset(new HarmonicEnergyLocalStiffness<GridType::LeafGridView, FEBasis::LocalFiniteElement, ATargetSpace>);
} else if (energy == "chiral_skyrmion")
{
localEnergy.reset(new GFE::ChiralSkyrmionEnergy<GridType::LeafGridView, FEBasis::LocalFiniteElement, adouble>);
} else
DUNE_THROW(Exception, "Unknown energy type '" << energy << "'");
LocalGeodesicFEADOLCStiffness<GridType::LeafGridView,
FEBasis::LocalFiniteElement,
TargetSpace> localGFEADOLCStiffness(&harmonicEnergyADOLCLocalStiffness);
TargetSpace> localGFEADOLCStiffness(localEnergy.get());
GeodesicFEAssembler<FEBasis,TargetSpace> assembler(grid->leafGridView(), &localGFEADOLCStiffness);
......
......@@ -38,6 +38,10 @@ instrumented = 0
# Problem specifications
############################
# Type of energy we are minimizing
#energy = harmonic
energy = chiral_skyrmion
# 2d problem
#structuredGrid = false
#path = /home/sander/data/richards/twosquares/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment