Skip to content
Snippets Groups Projects
Commit 83a7a4f4 authored by Lisa Julia Nebel's avatar Lisa Julia Nebel
Browse files

Instead of loading the volume load as a fixed (x,y,z) vector, load it as a...

Instead of loading the volume load as a fixed (x,y,z) vector, load it as a space-dependent Python function
parent 3b39a00c
No related branches found
No related tags found
2 merge requests!118Correct the dimension of the rotation and the deformation in the...,!110Experiments with the sphere
...@@ -403,15 +403,14 @@ int main (int argc, char *argv[]) try ...@@ -403,15 +403,14 @@ int main (int argc, char *argv[]) try
return nV; return nV;
}; };
FieldVector<double,3> volumeLoadValues {0,0,0}; Python::Reference volumeLoadClass = Python::import(parameterSet.get<std::string>("volumeLoadPythonFunction", "zero-volume-load"));
if (parameterSet.hasKey("volumeLoad")) Python::Callable volumeLoadCallable = volumeLoadClass.get("VolumeLoad");
volumeLoadValues = parameterSet.get<FieldVector<double,3> >("volumeLoad");
// Call a constructor
auto volumeLoad = [&]( FieldVector<double,dimworld>) { Python::Reference volumeLoadPythonObject = volumeLoadCallable(homotopyParameter);
auto vL = volumeLoadValues;
vL *= (-homotopyParameter); // Extract object member functions as Dune functions
return vL; auto volumeLoad = Python::make_function<FieldVector<double,3> > (volumeLoadPythonObject.get("volumeLoad"));
};
if (mpiHelper.rank() == 0) { if (mpiHelper.rank() == 0) {
std::cout << "Material parameters:" << std::endl; std::cout << "Material parameters:" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment