96 namespace py=pybind11;
99 py::class_<ExtrapolationMethod>(
m,
"ExtrapolationMethod")
101 .def(py::init<const int&,const double&>())
106 py::class_<InterpolantBase>(
m,
"InterpolantBase")
112 py::class_<LagrangeInterpolant,InterpolantBase>(
m,
"LagrangeInterpolant")
113 .def(py::init<const InterpolantBase::MatrixType&,const ExtrapolationMethod&>())
116 py::class_<LinearInterpolant,InterpolantBase>(
m,
"LinearInterpolant")
117 .def(py::init<const InterpolantBase::MatrixType&,const ExtrapolationMethod&>())
120 py::class_<GlidePlaneNoiseBase<1>, std::shared_ptr<GlidePlaneNoiseBase<1>>>(
m,
"GlidePlaneNoiseBase1")
121 .
def(py::init<
const std::string&,
const int&,
124 const Eigen::Matrix<double,2,2>&>())
130 py::class_<MDStackingFaultNoise, GlidePlaneNoiseBase<1>, std::shared_ptr<MDStackingFaultNoise>>(
m,
"MDStackingFaultNoise")
138 const Eigen::Matrix<double, 2, 2>&
142 py::class_<GlidePlaneNoiseBase<2>, std::shared_ptr<GlidePlaneNoiseBase<2>>>(
m,
"GlidePlaneNoiseBase2")
143 .
def(py::init<
const std::string&,
const int&,
146 const Eigen::Matrix<double,2,2>&>())
152 py::class_<MDSolidSolutionNoise, GlidePlaneNoiseBase<2>, std::shared_ptr<MDSolidSolutionNoise>>(
m,
"MDSolidSolutionNoise")
161 const Eigen::Matrix<double, 2, 2>&,
167 py::class_<AnalyticalSolidSolutionNoise, GlidePlaneNoiseBase<2>,std::shared_ptr<AnalyticalSolidSolutionNoise>>(
m,
"AnalyticalSolidSolutionNoise")
174 const Eigen::Matrix<double, 2, 2>&,
181 py::class_<DefectiveCrystalTraitsIO>(
m,
"DefectiveCrystalTraitsIO")
182 .def(py::init<const std::string&>())
197 py::class_<DefectiveCrystalParameters>(
m,
"DefectiveCrystalParameters")
198 .def(py::init<const std::string&>())
209 m.attr(
"SimplicialMesh")=
m.attr(
"SimplicialMesh3");
210 m.attr(
"SimplexReader")=
m.attr(
"SimplexReader3");
211 m.attr(
"Polyhedron0")=
m.attr(
"Polyhedron30");
212 m.attr(
"Polyhedron1")=
m.attr(
"Polyhedron31");
213 m.attr(
"Polyhedron2")=
m.attr(
"Polyhedron32");
214 m.attr(
"Polyhedron3")=
m.attr(
"Polyhedron33");
216 py::class_<PolycrystallineMaterialBase>(
m,
"PolycrystallineMaterialBase")
217 .def(py::init<const std::string&,const double&>())
231 py::class_<StressStraight<3,double>>(
m,
"StressStraight")
251 py::class_<std::map<std::pair<size_t,size_t>,
const std::shared_ptr<GrainBoundary<3>>>>(
m,
"GrainBoundaryMap")
255 py::class_<Lattice<3>>(
m,
"Lattice")
259 py::class_<LatticeVector<3>>(
m,
"LatticeVector")
271 py::class_<PeriodicLatticeInterpolant<2>,std::shared_ptr<PeriodicLatticeInterpolant<2>>>(
m,
"PeriodicLatticeInterpolant")
278 py::class_<GammaSurface,PeriodicLatticeInterpolant<2>,std::shared_ptr<GammaSurface>>(
m,
"GammaSurface")
279 .
def(py::init<
const Eigen::Matrix<double,2,2>&,
280 const Eigen::Matrix<double,Eigen::Dynamic,2>&,
281 const Eigen::Matrix<double,Eigen::Dynamic,3>&,
283 const std::vector<Eigen::Matrix<double,2,1>>&>())
288 py::class_<GlidePlaneBase,std::shared_ptr<GlidePlaneBase>>(
m,
"GlidePlaneBase")
296 py::class_<GlidePlane<3>,std::shared_ptr<GlidePlane<3>>>(
m,
"GlidePlane")
300 py::class_<SlipSystem,std::shared_ptr<SlipSystem>>(
m,
"SlipSystem")
308 py::class_<SecondPhase<3>,std::shared_ptr<SecondPhase<3>>>(
m,
"SecondPhase")
329 py::class_<SingleCrystalBase<3>,
Lattice<3>>(
m,
"SingleCrystalBase")
331 .
def(py::init<const PolycrystallineMaterialBase&,const MatrixDim&>())
343 py::class_<Grain<3>,std::shared_ptr<Grain<3>>>(
m,
"Grain")
355 py::class_<PeriodicGlidePlane<3>,std::shared_ptr<PeriodicGlidePlane<3>>>(
m,
"PeriodicGlidePlane")
359 py::class_<DislocationDynamicsBase<3>,std::shared_ptr<DislocationDynamicsBase<3>>>(
m,
"DislocationDynamicsBase")
362 const Eigen::Vector3d& normal,
size_t grainID)
364 const auto grain=base.polyOwner->grain(grainID);
365 return base.glidePlaneFactory.getFromKey(
GlidePlaneKey<3>(point,grain->reciprocalLatticeDirection(normal)));
366 }, py::keep_alive<0,1>())
368 const Eigen::Vector3d& normal,
size_t grainID)
370 const auto grain=base.polyOwner->grain(grainID);
371 return base.periodicGlidePlaneFactory.getFromKey(
GlidePlaneKey<3>(point,grain->reciprocalLatticeDirection(normal)));
372 }, py::keep_alive<0,1>())
375 return base.glidePlaneFactory.glidePlanes().size();
379 return base.periodicGlidePlaneFactory.periodicGlidePlanes().size();
382 py::class_<ClusterDynamicsBase<3>,std::shared_ptr<ClusterDynamicsBase<3>>>(
m,
"ClusterDynamicsBase")
404 py::class_<ElasticDeformationBase<3>,std::shared_ptr<ElasticDeformationBase<3>>>(
m,
"ElasticDeformationBase")
409 py::class_<DefectiveCrystalBase<3>,std::shared_ptr<DefectiveCrystalBase<3>>>(
m,
"DefectiveCrystalBase")
410 .
def(py::init<const std::string&>())
414 }, py::return_value_policy::reference_internal)
418 }, py::return_value_policy::reference_internal)
435 py::class_<MicrostructureBase<3>>(
m,
"MicrostructureBase")
440 py::class_<MicrostructureContainer<3>,
MicrostructureBase<3>>(
m,
"MicrostructureContainer",py::multiple_inheritance())
445 py::bind_map<std::map<typename LoopNodeType::KeyType,const std::weak_ptr<LoopNodeType>>>(
m,
"LoopNodeWeakPtrMap");
447 py::class_<WeakPtrFactory<DislocationNetworkType,LoopNodeType>
448 ,std::map<typename LoopNodeType::KeyType,const std::weak_ptr<LoopNodeType>>
449 >(
m,
"LoopNodeWeakPtrFactory")
457 const std::shared_ptr<LoopType>&,
458 const std::shared_ptr<NetworkNodeType>&,
465 py::bind_vector<std::vector<MeshedDislocationLoop>>(
m,
"MeshedDislocationLoopVector");
467 py::bind_map<std::map<typename LoopType::KeyType,const std::weak_ptr<LoopType>>>(
m,
"LoopWeakPtrMap");
469 py::class_<WeakPtrFactory<DislocationNetworkType,LoopType>
470 ,std::map<typename LoopType::KeyType,const std::weak_ptr<LoopType>>
471 >(
m,
"LoopWeakPtrFactory")
480 const std::shared_ptr<GlidePlaneType>&>())
481 .def(
"solidAngle",&LoopType::solidAngle)
482 .def(
"meshed",&LoopType::meshed)
483 .def(
"slippedArea",&LoopType::slippedArea)
484 .def_readonly(
"glidePlane", &LoopType::glidePlane)
485 .def(
"averagePlasticDistortion",&LoopType::averagePlasticDistortion)
489 >(
m,
"MeshedDislocationLoop")
501 py::class_<LoopNetwork<DislocationNetworkType>
504 >(
m,
"LoopNetwork",py::multiple_inheritance())
517 py::class_<DefectiveCrystal<3>
519 >(
m,
"DefectiveCrystal")
527 py::class_<DefectiveCrystalConfigIO<3>
528 >(
m,
"DefectiveCrystalConfigIO")
529 .
def(py::init<const std::string&>(), py::arg(
"folderName")=
"config")
534 >(
m,
"MicrostructureGenerator")
556 >(
m,
"ShearLoopDensitySpecification")
558 .def(py::init<const std::string&>())
568 >(
m,
"ShearLoopIndividualSpecification")
570 .def(py::init<const std::string&>())
573 .def_property(
"loopCenters",
587 >(
m,
"PeriodicDipoleDensitySpecification")
589 .def(py::init<const std::string&>())
594 >(
m,
"PeriodicDipoleIndividualSpecification")
596 .def(py::init<const std::string&>())
599 .def_property(
"dipoleCenters",
602 return self.dipoleCenters;
606 self.dipoleCenters = val;
615 >(
m,
"PrismaticLoopDensitySpecification")
617 .def(py::init<const std::string&>())
626 >(
m,
"PrismaticLoopIndividualSpecification")
628 .def(py::init<const std::string&>())
631 .def_property(
"loopCenters",
645 >(
m,
"FrankLoopsDensitySpecification")
647 .def(py::init<const std::string&>())
659 >(
m,
"FrankLoopsIndividualSpecification")
661 .def(py::init<const std::string&>())
664 .def_property(
"loopCenters",
679 >(
m,
"PlanarLoopIndividualSpecification")
681 .def(py::init<const std::string&>())
684 .def_property(
"loopPoints",
687 return self.loopPoints;
691 self.loopPoints = val;
699 >(
m,
"StackingFaultTetrahedraDensitySpecification")
701 .def(py::init<const std::string&>())
708 >(
m,
"StackingFaultTetrahedraIndividualSpecification")
710 .def(py::init<const std::string&>())
714 .def_property(
"basePoints",
717 return self.basePoints;
721 self.basePoints = val;
727 >(
m,
"SphericalInclusionDensitySpecification")
729 .def(py::init<const std::string&>())
734 .def_property(
"crystalEigenDistortion",
737 return self.crystalEigenDistortion;
741 self.crystalEigenDistortion = val;
744 .def_property(
"patternVector_SI",
747 return self.patternVector_SI;
751 self.patternVector_SI = val;
761 >(
m,
"SphericalInclusionIndividualSpecification")
763 .def(py::init<const std::string&>())
765 .def_property(
"centers",
775 .def_property(
"crystalEigenDistortions",
778 return self.crystalEigenDistortions;
782 self.crystalEigenDistortions = val;
791 py::class_<EllipsoidalInclusionDensitySpecification>(
m,
"EllipsoidalInclusionDensitySpecification")
793 .def(py::init<const std::string&>())
807 py::class_<EllipsoidalInclusionIndividualSpecification>(
m,
"EllipsoidalInclusionIndividualSpecification")
809 .def(py::init<const std::string&>())
820 >(
m,
"PolyhedronInclusionIndividualSpecification")
822 .def(py::init<const std::string&>())
844 .def_property(
"crystalEigenDistortion",
847 return self.crystalEigenDistortion;
851 self.crystalEigenDistortion = val;
859 py::class_<DislocationMobility,std::shared_ptr<DislocationMobility>>(
m,
"DislocationMobility")
860 .
def(
"velocity",
static_cast<double (
DislocationMobility::*)(
const Eigen::Matrix<double,3,3>&,
const Eigen::Matrix<double,3,1>&,
const Eigen::Matrix<double,3,1>&,
const Eigen::Matrix<double,3,1>&,
const double&) const
>(&
DislocationMobility::velocity))
863 py::class_<DislocationMobilityBase,std::shared_ptr<DislocationMobilityBase>>(
m,
"DislocationMobilityBase")
864 .
def(
"velocity",
static_cast<double (
DislocationMobilityBase::*)(
const Eigen::Matrix<double,3,3>&,
const Eigen::Matrix<double,3,1>&,
const Eigen::Matrix<double,3,1>&,
const double&) const
>(&
DislocationMobilityBase::velocity))
867 py::class_<DislocationMobilitySelector>(
m,
"DislocationMobilitySelector")
873 py::class_<DislocationMobilityViscousDrag,DislocationMobilityBase,std::shared_ptr<DislocationMobilityViscousDrag>>(
m,
"DislocationMobilityViscousDrag")
878 py::class_<DislocationMobilityKinkPair,DislocationMobilityBase,std::shared_ptr<DislocationMobilityKinkPair>>(
m,
"DislocationMobilityKinkPair")