diff --git a/NonLinearSolver/contact/contactTerms.cpp b/NonLinearSolver/contact/contactTerms.cpp index 24af17d5b8da4e4545d4b41dd945b54da58946fc..0a9f532e75f059b98d9ba47ff7062cea1518fc7c 100644 --- a/NonLinearSolver/contact/contactTerms.cpp +++ b/NonLinearSolver/contact/contactTerms.cpp @@ -84,7 +84,7 @@ template<> void defoDefoContactBilinearTermByPerturbation<double>::get(contactEl disp(j)+=_pert; for(int i=0; i<nbdofs; i++) { - m(i,j)=(Fplus(i)-Fminus(i))/(-2.*_pert); //minus because stiffness related toof internal force + m(i,j)=(Fplus(i)-Fminus(i))/(2.*_pert); // } } defoDefoTerm->get(cE,npts,GP,Fminus,disp);// put back the right _nodesInContact diff --git a/NonLinearSolver/modelReduction/Optimizer.h b/NonLinearSolver/modelReduction/Optimizer.h index e36297d5771607ed79bc18736e227c4e2043b71a..d3db3e9fd77f9c6f6ad10f1af34642f072afaef5 100644 --- a/NonLinearSolver/modelReduction/Optimizer.h +++ b/NonLinearSolver/modelReduction/Optimizer.h @@ -53,6 +53,11 @@ class LossFunction */ virtual void initializeFittingParameters(fullVector<double>& W) = 0; + /*! @param[out] WLower lower bound of the fitting parameters + * @param[out] WUpper upper bound of the fitting parameters + */ + virtual void getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const = 0; + /*! \brief update the model with the new fitting parameter @param[in] W the fitting parameters */ diff --git a/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.cpp b/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.cpp index 89bff9c5eb4e08623986c7589a47aaf5cb253c1f..0cf2d4d7aa8d56ef48510aeedb81a0fa81f8fe48 100644 --- a/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.cpp +++ b/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.cpp @@ -870,7 +870,15 @@ void TrainingDeepMaterialNetworkLinearElastic::saveModel(const std::string fname void TrainingDeepMaterialNetworkLinearElastic::initializeFittingParameters(fullVector<double>& W) { numberDofs(W); -} +}; + +// get bounds of fitting parmaters +void TrainingDeepMaterialNetworkLinearElastic::getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const +{ + Msg::Error("TrainingDeepMaterialNetworkLinearElastic::getUnknownBounds has not been implemeneted"); + Msg::Exit(1); +}; + // update the model with the new fitting parameter void TrainingDeepMaterialNetworkLinearElastic::updateModelFromFittingParameters(const fullVector<double>& W) { diff --git a/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.h b/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.h index d5373ff2102a1543e778b4bb5efa28aaecde82c6..6b031e0bde50747d6f461b7cfdde1026ca42c773 100644 --- a/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.h +++ b/NonLinearSolver/modelReduction/TrainingArbitraryDeepMaterialNetworks.h @@ -106,6 +106,8 @@ class TrainingDeepMaterialNetworkLinearElastic : public TrainingArbitraryDeepMat virtual void saveModel(const std::string fname) const; // start numbering fitting parameters virtual void initializeFittingParameters(fullVector<double>& W); + // get bounds of fitting parmaters + virtual void getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const; // update the model with the new fitting parameter virtual void updateModelFromFittingParameters(const fullVector<double>& W); // in case of fails diff --git a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.cpp b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.cpp index 3c963eec91918fdb9e2dc4b1b9dbcfb3fd0795fb..9f010a1159c1629661d476eaa3439125a9a3524c 100644 --- a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.cpp +++ b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.cpp @@ -4028,7 +4028,84 @@ void TrainingDeepMaterialNetwork::saveModel(const std::string fname) const void TrainingDeepMaterialNetwork::initializeFittingParameters(fullVector<double>& W) { numberDofs(W); -} +}; + +void TrainingDeepMaterialNetwork::getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const +{ + // Dof of all nodes + Tree::nodeContainer allNodes; + _T->getAllNodes(allNodes); + + // initialize data from tree + // + int sizeOfR = _unknown.size(); + WLower.resize(sizeOfR,true); + WUpper.resize(sizeOfR,true); + // + for (int i=0; i< allNodes.size(); i++) + { + const TreeNode& node = *(allNodes[i]); + std::vector<Dof> R; + getKeys(&node,R); + int Rsize = R.size(); + if (node.childs.size() ==0) + { + int numCoh = 0; + int numCohDirVars = 0; + if (node.withCohesive()) + { + numCoh = node.cohesiveCoeffVars.size(); + numCohDirVars = node.cohesiveDirectionVars.size2(); + } + for (int j=0; j< Rsize; j++) + { + std::map<Dof,int>::const_iterator itR = _unknown.find(R[j]); + if (itR != _unknown.end()) + { + if (j == 0) + { + // leaf + WLower(itR->second) = node.af->getReciprocalVal(0.001); + WUpper(itR->second) = node.af->getReciprocalVal(1); + } + else if ((j > 0) && (j< numCoh+1)) + { + WLower(itR->second) = 0.1; + WUpper(itR->second) = 0.9; + } + else if ((j >= numCoh+1) && (j < numCoh*numCohDirVars+numCoh+1)) + { + int index = j -(numCoh+1); + int k = index/numCohDirVars; + int l = index%numCohDirVars; + //Msg::Info("index = %d k=%d, l=%d",index,k,l); + WLower(itR->second) = 0; + WUpper(itR->second) = 1.; + } + else + { + Msg::Error("wrong position"); + Msg::Exit(0); + } + }; + } + } + else + { + for (int j=0; j< Rsize; j++) + { + std::map<Dof,int>::const_iterator itR = _unknown.find(R[j]); + if (itR != _unknown.end()) + { + WLower(itR->second) = 0; + WUpper(itR->second) = 1.; + }; + } + } + }; +}; + + // update the model with the new fitting parameter void TrainingDeepMaterialNetwork::updateModelFromFittingParameters(const fullVector<double>& W) { diff --git a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.h b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.h index 34a1849a00b23cfdce9cc81ab8db7a2b7a7c4f03..8e5de7ed10455a847398d5596d5a84d3fc728dc7 100644 --- a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.h +++ b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworks.h @@ -403,6 +403,8 @@ class TrainingDeepMaterialNetwork : public LossFunction virtual void saveModel(const std::string fname) const; // start numbering fitting parameters virtual void initializeFittingParameters(fullVector<double>& W); + // get bounds of fitting paraeters + virtual void getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const; // update the model with the new fitting parameter virtual void updateModelFromFittingParameters(const fullVector<double>& W); // in case of fails diff --git a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.cpp b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.cpp index 7d2752e00f3b1873cc18b5ff20705064c1446c76..6f2d9b1067c9c0b2e322a8666662c3ef412a2ba5 100644 --- a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.cpp +++ b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.cpp @@ -1811,6 +1811,13 @@ void TrainingDeepMaterialNetworkNonLinear::initializeFittingParameters(fullVecto { numberDofs(W); } + +// get bounds of fitting parmaters +void TrainingDeepMaterialNetworkNonLinear::getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const +{ + Msg::Error("TrainingDeepMaterialNetworkNonLinear::getUnknownBounds has not been implemeneted"); + Msg::Exit(1); +}; // update the model with the new fitting parameter void TrainingDeepMaterialNetworkNonLinear::updateModelFromFittingParameters(const fullVector<double>& W) { diff --git a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.h b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.h index 5dbafa39912552ee22693e8dec971f905d60c552..3bf011cd2019d89cda8e69f37434057c4aa7db13 100644 --- a/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.h +++ b/NonLinearSolver/modelReduction/TrainingDeepMaterialNetworksNonLinear.h @@ -208,6 +208,8 @@ class TrainingDeepMaterialNetworkNonLinear : public TrainingArbitraryDeepMateria virtual void saveModel(const std::string fname) const; // start numbering fitting parameters virtual void initializeFittingParameters(fullVector<double>& W); + // get bounds of fitting paraeters + virtual void getUnknownBounds(fullVector<double>& WLower, fullVector<double>& WUpper) const; // update the model with the new fitting parameter virtual void updateModelFromFittingParameters(const fullVector<double>& W); // in case of fails diff --git a/NonLinearSolver/nlmechsolpy.i b/NonLinearSolver/nlmechsolpy.i index 5afc90c09c6142f7f649941acf9846a527657e83..f030bdaa3e77ba0604619e63e6b81eaef0123e25 100644 --- a/NonLinearSolver/nlmechsolpy.i +++ b/NonLinearSolver/nlmechsolpy.i @@ -1,3 +1,11 @@ +%include std_string.i +%include std_vector.i +%include std_map.i + +%template(vectorInt) std::vector<int>; +%template(vectorDouble) std::vector<double>; +%template(vectorString) std::vector<std::string>; + %{ #undef HAVE_DLOPEN #include "NonLinearSolverConfig.h" diff --git a/dG3D/benchmarks/GursonPlasticInstabilities_PathFollowing/Plane_notch.py b/dG3D/benchmarks/GursonPlasticInstabilities_PathFollowing/Plane_notch.py index c3226c3468763ae82c94633b9611da72288c369c..d2c2585e59f14a30b25739e83b5567a4e410fc6d 100644 --- a/dG3D/benchmarks/GursonPlasticInstabilities_PathFollowing/Plane_notch.py +++ b/dG3D/benchmarks/GursonPlasticInstabilities_PathFollowing/Plane_notch.py @@ -190,4 +190,4 @@ mysolver.archivingIPOnPhysicalGroup("Face", 700, IPField.LOCAL_POROSITY,IPField. mysolver.solve() check = TestCheck() -check.equal(-1.957777e+03,mysolver.getArchivedForceOnPhysicalGroup("Edge", 1400, 0),1.e-6) +check.equal(-1.957901e+03,mysolver.getArchivedForceOnPhysicalGroup("Edge", 1400, 0),1.e-6) diff --git a/dG3D/benchmarks/GursonThomasonMultipleNonlocalVar_PathFollowing/Plane_notch.py b/dG3D/benchmarks/GursonThomasonMultipleNonlocalVar_PathFollowing/Plane_notch.py index fe97c5ec531838e2d58de0f1b963cb54b5da37dc..ca1b4e10b8343ff12b1c11156c06a8efdc04f2ac 100644 --- a/dG3D/benchmarks/GursonThomasonMultipleNonlocalVar_PathFollowing/Plane_notch.py +++ b/dG3D/benchmarks/GursonThomasonMultipleNonlocalVar_PathFollowing/Plane_notch.py @@ -190,4 +190,4 @@ mysolver.archivingIPOnPhysicalGroup("Face", 700, IPField.LOCAL_POROSITY,IPField. mysolver.solve() check = TestCheck() -check.equal(-5.458367e+01,mysolver.getArchivedForceOnPhysicalGroup("Edge", 1400, 0),1.e-6) +check.equal(-5.458283e+01,mysolver.getArchivedForceOnPhysicalGroup("Edge", 1400, 0),1.e-6) diff --git a/dG3D/benchmarks/GursonThomason_cube_I1J2J3_Transition/cube.py b/dG3D/benchmarks/GursonThomason_cube_I1J2J3_Transition/cube.py index f658faf6a8247496baf6f1e5a8fde611e4982072..9ff9882b1095757d3dd388a77974b0d003ab5f66 100644 --- a/dG3D/benchmarks/GursonThomason_cube_I1J2J3_Transition/cube.py +++ b/dG3D/benchmarks/GursonThomason_cube_I1J2J3_Transition/cube.py @@ -71,7 +71,7 @@ nstepArchIP=1 # Number of step between 2 archiving nstepArchForce = 1 # Number of step between 2 force archiving nstepArchEnergy = nstepArchForce # Number of step between 2 energy computation and archiving -MaxIter = 12 # Maximum number of iterations +MaxIter = 16 # Maximum number of iterations StepIncrease = 2 # Number of successfull timestep before reincreasing it StepReducFactor = 2 # Timestep reduction factor NumberReduction = 100 # Maximum number of timespep reduction: max reduction = pow(StepReducFactor,this) diff --git a/dG3D/benchmarks/GursonThomason_cube_Transition/cube.py b/dG3D/benchmarks/GursonThomason_cube_Transition/cube.py index d89de700fc0eadef1350886a212ae23766675f8e..30954273e3fdf625c3a0835c39c7b1c25a09809a 100644 --- a/dG3D/benchmarks/GursonThomason_cube_Transition/cube.py +++ b/dG3D/benchmarks/GursonThomason_cube_Transition/cube.py @@ -68,7 +68,7 @@ nstepArchIP=1 # Number of step between 2 archiving nstepArchForce = 1 # Number of step between 2 force archiving nstepArchEnergy = nstepArchForce # Number of step between 2 energy computation and archiving -MaxIter = 12 # Maximum number of iterations +MaxIter = 16 # Maximum number of iterations StepIncrease = 2 # Number of successfull timestep before reincreasing it StepReducFactor = 2 # Timestep reduction factor NumberReduction = 100 # Maximum number of timespep reduction: max reduction = pow(StepReducFactor,this) diff --git a/dG3D/benchmarks/GursonThomason_cube_withLodeEnhanced/cube.py b/dG3D/benchmarks/GursonThomason_cube_withLodeEnhanced/cube.py index 6b979f5756b512b65da2db766297858b363bed58..07b4caf0a1d8c7219cb468ff6897ca5da71f1c14 100644 --- a/dG3D/benchmarks/GursonThomason_cube_withLodeEnhanced/cube.py +++ b/dG3D/benchmarks/GursonThomason_cube_withLodeEnhanced/cube.py @@ -197,7 +197,7 @@ check = TestCheck() import csv data = csv.reader(open('IPVolume11val_LOCAL_POROSITYMax.csv'), delimiter=';') porosity = list(data) -check.equal(4.420505e-01,float(porosity[-1][1]),1e-6) +check.equal(4.415553e-01,float(porosity[-1][1]),1e-6) diff --git a/dG3D/benchmarks/Inno_EMT_test/InnoElecMagTherm.py b/dG3D/benchmarks/Inno_EMT_test/InnoElecMagTherm.py index 6450fce5970fbede8c5a08f196e85d764a971f19..7ffa44c43e8e6c586c8663c36f98404c50fc4dc5 100644 --- a/dG3D/benchmarks/Inno_EMT_test/InnoElecMagTherm.py +++ b/dG3D/benchmarks/Inno_EMT_test/InnoElecMagTherm.py @@ -296,7 +296,7 @@ check.equal(0.000000e+00,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSm #check.equal(3.399153e-04,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 4),1.e-5) check.equal(-3.484000e-03,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 4),1.e-2) check.equal(3.144224e-03,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 4),1.e-5) -check.equal(-6.802441e-04,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) +check.equal(-6.785826e-04,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) check.equal(3.720132e-01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 5),1.e-5) check.equal(5.949466e+03,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 5),1.e-5) check.equal(0.0,mysolver.getArchivedNodalValue(SmpRefPoint,0,mysolver.displacement),1.e-5) diff --git a/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuad/squares.py b/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuad/squares.py index c91587b3d6de5f2c9ebba16a944374beefabca07..e98351593698f9d6bb8ada2a22acbcbce1000d4e 100644 --- a/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuad/squares.py +++ b/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuad/squares.py @@ -59,7 +59,7 @@ mysolver.displacementBC("Face",nfield1,2,0.) mysolver.displacementBC("Face",nfield2,2,0.) #compression along z mysolver.displacementBC("Edge",12,0,0.) -mysolver.displacementBC("Edge",12,2,0.) +mysolver.displacementBC("Edge",12,1,0.) d1=-0.00025 cyclicFunction1=cycleFunctionTime(0.,0.,ftime/4., d1/2., ftime/2., 0., 3.*ftime/4., d1/2., ftime, d1); #cyclicFunction1=cycleFunctionTime(0.,0.,ftime, d1); @@ -93,6 +93,6 @@ mysolver.archivingForceOnPhysicalGroup("Edge", 156, 1) mysolver.solve() check = TestCheck() -check.equal(2.451079e+07,mysolver.getArchivedForceOnPhysicalGroup("Edge", 12, 1),1.e-6) +check.equal(2.450488e+07,mysolver.getArchivedForceOnPhysicalGroup("Edge", 12, 1),1.e-6) diff --git a/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuadPert/squares.py b/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuadPert/squares.py index d7bee5a4d3e0d8fc361cf57800b4b301fb50bd2e..6090bb2ea12ab957aa86287fbf86ccad80c377e3 100644 --- a/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuadPert/squares.py +++ b/dG3D/benchmarks/defoDefoContactSlaveEdge2DQuadPert/squares.py @@ -95,6 +95,6 @@ mysolver.archivingForceOnPhysicalGroup("Edge", 156, 1) mysolver.solve() check = TestCheck() -check.equal(2.451079e+07,mysolver.getArchivedForceOnPhysicalGroup("Edge", 12, 1),1.e-6) +check.equal(2.450488e+07,mysolver.getArchivedForceOnPhysicalGroup("Edge", 12, 1),1.e-6) diff --git a/dG3D/benchmarks/linearEMT/LinearElecMagTherm.py b/dG3D/benchmarks/linearEMT/LinearElecMagTherm.py index b1b0505e73c0f0f07004f6bd624804418eec436b..6fccb2db8fa401026b42659a8ba28d2e2ae99b49 100644 --- a/dG3D/benchmarks/linearEMT/LinearElecMagTherm.py +++ b/dG3D/benchmarks/linearEMT/LinearElecMagTherm.py @@ -290,13 +290,12 @@ mysolver.archivingNodeDisplacement(SmpRefPoint,4,1); #mysolver.archivingNodeIP(SmpRef, IPField.ELECTRICALFLUX_X,IPField.MEAN_VALUE,1); mysolver.solve() - check = TestCheck() check.equal(0.000000e+00,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 3),1.e-5) check.equal(-9.427355e-10,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 4),1.e1) check.equal(9.484542e-05,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 4),1.e1) check.equal(-7.110362e-08,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 4),1.e-1) -check.equal(3.662529e-01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) +check.equal(3.691623e-01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) check.equal(2.895048e+00,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 5),1.e-5) check.equal(-1.265934e+02,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 5),1.e-5) check.equal(0.0,mysolver.getArchivedNodalValue(SmpRefPoint,0,mysolver.displacement),1.e-5) diff --git a/dG3D/benchmarks/linearEMT_Pert/LinearElecMagTherm_Pert.py b/dG3D/benchmarks/linearEMT_Pert/LinearElecMagTherm_Pert.py index 571e67f3029fff8db2cb2250ede6d696b4868b69..617234446a4e14f939edf6b417a354620f7c090a 100644 --- a/dG3D/benchmarks/linearEMT_Pert/LinearElecMagTherm_Pert.py +++ b/dG3D/benchmarks/linearEMT_Pert/LinearElecMagTherm_Pert.py @@ -293,7 +293,7 @@ check = TestCheck() check.equal(0.000000e+00,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 3),1.e-5) check.equal(0.000000e+00,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 4),1.e-5) check.equal(-3.322070e-05,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 4),1.e-5) -check.equal(1.017284e-07,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 4),1.e-5) +check.equal(1.017297e-07,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 4),1.e-5) check.equal(2.235121e+01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) check.equal(-6.599484e+01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 5),1.e-5) check.equal(-1.150381e+02,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 5),1.e-5) diff --git a/dG3D/benchmarks/linearElectroMagnetic/LinearElecMag.py b/dG3D/benchmarks/linearElectroMagnetic/LinearElecMag.py index add8b618301282dcb67bf37a18710d56933471c7..e0eb00234c4e6566573987536eb54f575dabb2a3 100644 --- a/dG3D/benchmarks/linearElectroMagnetic/LinearElecMag.py +++ b/dG3D/benchmarks/linearElectroMagnetic/LinearElecMag.py @@ -289,7 +289,7 @@ check.equal(-6.996190e+11,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfS check.equal(0.000000e+00,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 4),1.e-5) check.equal(-1.789120e-08,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 4),1.e-2) check.equal(1.786247e-08,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 4),1.e-2) -check.equal(2.291965e-01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) +check.equal(2.286854e-01 ,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfSmp, 5),1.e-5) check.equal(-6.912008e-01,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfInd, 5),1.e-5) check.equal(-3.522141e+02,mysolver.getArchivedForceOnPhysicalGroup("Face", SurfVacOut, 5),1.e-5) check.equal(0.0,mysolver.getArchivedNodalValue(SmpRefPoint,0,mysolver.displacement),1.e-5) @@ -297,4 +297,3 @@ check.equal(0.0,mysolver.getArchivedNodalValue(SmpRefPoint,1,mysolver.displaceme check.equal(0.0,mysolver.getArchivedNodalValue(SmpRefPoint,2,mysolver.displacement),1.e-5) check.equal(2.980000e+02,mysolver.getArchivedNodalValue(SmpRefPoint,3,mysolver.displacement),1.e-5) check.equal(-6.173236e-04,mysolver.getArchivedNodalValue(SmpRefPoint,4,mysolver.displacement),1.e-5) - diff --git a/dG3D/benchmarks/multiscale_2order_shearlayer_pert/shearlayerPert.py b/dG3D/benchmarks/multiscale_2order_shearlayer_pert/shearlayerPert.py index 62e28f352a131e6c529c5ce27a4e32d504901557..68e213149674232725c1ef805c2f4e1ebc6ba471 100644 --- a/dG3D/benchmarks/multiscale_2order_shearlayer_pert/shearlayerPert.py +++ b/dG3D/benchmarks/multiscale_2order_shearlayer_pert/shearlayerPert.py @@ -149,5 +149,5 @@ mysolver.solve() #test check check = TestCheck() -check.equal(4.649837e+02,mysolver.getArchivedForceOnPhysicalGroup("Edge",2,1),1.e-5) +check.equal(4.649913e+02,mysolver.getArchivedForceOnPhysicalGroup("Edge",2,1),1.e-5) diff --git a/dG3D/benchmarks/nanoIndentation/ni.py b/dG3D/benchmarks/nanoIndentation/ni.py index 1c1058196a56ab336cfda8395647a7c58b226f0f..53418d66d1cedf3650f2b38381e04bf54564af93 100644 --- a/dG3D/benchmarks/nanoIndentation/ni.py +++ b/dG3D/benchmarks/nanoIndentation/ni.py @@ -166,7 +166,7 @@ mysolver.archivingRigidContactForce(22, 2, 1) mysolver.solve() check = TestCheck() -check.equal(-2.811155e-04,mysolver.getArchivedNodalValue(1001,2,mysolver.displacement),1.e-4) +check.equal(-2.816262e-04,mysolver.getArchivedNodalValue(1001,2,mysolver.displacement),1.e-4) diff --git a/dG3D/benchmarks/nonLinearTVE_uniaxial/CMakeLists.txt b/dG3D/benchmarks/nonLinearTVE_uniaxial/CMakeLists.txt index 4280a73b8d83dbdee75158287605adde323c3ab2..0415f975c311d60a4b45010eec52d49841d9231f 100644 --- a/dG3D/benchmarks/nonLinearTVE_uniaxial/CMakeLists.txt +++ b/dG3D/benchmarks/nonLinearTVE_uniaxial/CMakeLists.txt @@ -3,7 +3,9 @@ set(PYFILE runTVE.py) set(FILES2DELETE - *.csv + for*.csv + ene*.csv + Nod*.csv disp* stress* ) diff --git a/dG3D/benchmarks/nonLinearTVE_uniaxial/runTVE.py b/dG3D/benchmarks/nonLinearTVE_uniaxial/runTVE.py index c3c4f2c271c0bcee79fc625c2092298e4b34a7dc..7f23125ba483929747a12350dcb24d4bfcb6aef1 100644 --- a/dG3D/benchmarks/nonLinearTVE_uniaxial/runTVE.py +++ b/dG3D/benchmarks/nonLinearTVE_uniaxial/runTVE.py @@ -1,8 +1,8 @@ #coding-Utf-8-*- from gmshpy import * -# from dG3Dpy import* -from dG3DpyDebug import* +from dG3Dpy import* +#from dG3DpyDebug import* from math import* import csv import numpy as np diff --git a/dG3D/benchmarks/nonLinearTVP_uniaxial/CMakeLists.txt b/dG3D/benchmarks/nonLinearTVP_uniaxial/CMakeLists.txt index 2fc83dfce3c15a3e685eff4aa49e2103b016847a..256609072fdb2f84e9210e04b42b0f0933d0321b 100644 --- a/dG3D/benchmarks/nonLinearTVP_uniaxial/CMakeLists.txt +++ b/dG3D/benchmarks/nonLinearTVP_uniaxial/CMakeLists.txt @@ -3,7 +3,9 @@ set(PYFILE runTVP.py) set(FILES2DELETE - *.csv + for*.csv + ene*.csv + Nod*.csv disp* stress* ) diff --git a/dG3D/benchmarks/nonLinearTVP_uniaxial/runTVP.py b/dG3D/benchmarks/nonLinearTVP_uniaxial/runTVP.py index 49bc9965b1ef4cbc56950cd86a26d3ddf48889b3..9d739b6f2310d7c14911c6bbb8e6302f56f145d2 100644 --- a/dG3D/benchmarks/nonLinearTVP_uniaxial/runTVP.py +++ b/dG3D/benchmarks/nonLinearTVP_uniaxial/runTVP.py @@ -1,8 +1,8 @@ #coding-Utf-8-*- from gmshpy import * -# from dG3Dpy import* -from dG3DpyDebug import* +from dG3Dpy import* +#from dG3DpyDebug import* from math import* import csv import numpy as np diff --git a/dG3D/benchmarks/powerYieldViscoElastoPlastic/cylinder.py b/dG3D/benchmarks/powerYieldViscoElastoPlastic/cylinder.py index 9a8bc1dc45c872a38533384af4f7a30afcfa80a9..f2e392b99fdcde510e804ebe99fb98c1053f9f72 100644 --- a/dG3D/benchmarks/powerYieldViscoElastoPlastic/cylinder.py +++ b/dG3D/benchmarks/powerYieldViscoElastoPlastic/cylinder.py @@ -1,7 +1,7 @@ #coding-Utf-8-*- from gmshpy import * -# from dG3Dpy import* +from dG3Dpy import* from math import* #script to launch PBC problem with a python script diff --git a/dG3D/benchmarks/shiftMultiSystem/run.py b/dG3D/benchmarks/shiftMultiSystem/run.py index 84b4af2b88ab075fd93e47fb931800a28c054df7..cf75bcce936f0a8a1d97a6f77ccc0d0c8ff9406c 100644 --- a/dG3D/benchmarks/shiftMultiSystem/run.py +++ b/dG3D/benchmarks/shiftMultiSystem/run.py @@ -13,7 +13,7 @@ else: data1 = csv.reader(open('force102comp0_part2.csv'), delimiter=';') force = list(data1) -checkEqual(1235.178136860775,float(force[-1][1]),1e-5) +checkEqual(1.236021e+03,float(force[-1][1]),1e-5) if sys.version_info[0] < 3: os.system('mpiexec -np 4 python fullPlateHoleRes.py') @@ -22,5 +22,5 @@ else: data21 = csv.reader(open('force102comp0_part2.csv'), delimiter=';') force2 = list(data21) -checkEqual(1.235168e+03,float(force2[-1][1]),1e-5) +checkEqual(1.236021e+03,float(force2[-1][1]),1e-5) diff --git a/dG3D/benchmarks/test1DUniaxialStress/line.msh b/dG3D/benchmarks/test1DUniaxialStress/line.msh new file mode 100644 index 0000000000000000000000000000000000000000..300468701e9a451011c7a40c5e7fa9e4acec4482 --- /dev/null +++ b/dG3D/benchmarks/test1DUniaxialStress/line.msh @@ -0,0 +1,325 @@ +$MeshFormat +4.1 0 8 +$EndMeshFormat +$Entities +2 1 0 0 +1 0 0 0 1 1 +2 5 0 0 1 2 +1 0 0 0 5 0 0 1 11 2 1 -2 +$EndEntities +$Nodes +3 101 1 101 +0 1 0 1 +1 +0 0 0 +0 2 0 1 +2 +5 0 0 +1 1 0 99 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +0.008233330448046892 0 0 +0.01671366073030414 0 0 +0.02544840063616353 0 0 +0.0344451821142551 0 0 +0.04371186713335751 0 0 +0.05325655264591833 0 0 +0.06308757804567544 0 0 +0.07321353429759644 0 0 +0.08364327016126007 0 0 +0.09438589772837597 0 0 +0.1054508038341165 0 0 +0.116847657847122 0 0 +0.1285864174104397 0 0 +0.1406773392804196 0 0 +0.1531309884214111 0 0 +0.1659582477122095 0 0 +0.1791703248554747 0 0 +0.1927787641551272 0 0 +0.2067954569082466 0 0 +0.2212326499824571 0 0 +0.2361029584353169 0 0 +0.2514193765698796 0 0 +0.2671952874553593 0 0 +0.2834444752151047 0 0 +0.3001811381713936 0 0 +0.31741990151803 0 0 +0.3351758286477699 0 0 +0.3534644330434303 0 0 +0.372301695495865 0 0 +0.3917040756117358 0 0 +0.4116885272296583 0 0 +0.432272512798794 0 0 +0.4534740172083889 0 0 +0.4753115671982825 0 0 +0.4978042439575176 0 0 +0.520971700931929 0 0 +0.5448341817706615 0 0 +0.5694125369005317 0 0 +0.5947282424023436 0 0 +0.6208034187749437 0 0 +0.6476608509325344 0 0 +0.6753240059882035 0 0 +0.7038170554800255 0 0 +0.7331648967852645 0 0 +0.7633931734527039 0 0 +0.7945282980073765 0 0 +0.8265974760555226 0 0 +0.8596287296792313 0 0 +0.8936509210234185 0 0 +0.9286937785359755 0 0 +0.9647879213936159 0 0 +1.001964887620402 0 0 +1.040257162862379 0 0 +1.079698207465576 0 0 +1.120322483942211 0 0 +1.162165487739258 0 0 +1.205263781406641 0 0 +1.249655024654076 0 0 +1.295378004791349 0 0 +1.342472673657588 0 0 +1.39098018338702 0 0 +1.440942918706007 0 0 +1.492404535631868 0 0 +1.545410001557268 0 0 +1.600005632041137 0 0 +1.656239130588693 0 0 +1.714159633125633 0 0 +1.773817751330627 0 0 +1.835265613048903 0 0 +1.898556910216334 0 0 +1.96374694661764 0 0 +2.030892683771098 0 0 +2.100052793161879 0 0 +2.171287705953465 0 0 +2.244659665685397 0 0 +2.320232784225052 0 0 +2.398073096583552 0 0 +2.478248619015515 0 0 +2.560829407381226 0 0 +2.645887618903809 0 0 +2.733497576706765 0 0 +2.823735833604651 0 0 +2.916681238749485 0 0 +3.012415006011735 0 0 +3.111020785442104 0 0 +3.212584737870448 0 0 +3.31719560959661 0 0 +3.424944807044433 0 0 +3.535926480453506 0 0 +3.650237604904716 0 0 +3.76797806264756 0 0 +3.889250734011282 0 0 +4.014161585860751 0 0 +4.142819763141486 0 0 +4.27533768492177 0 0 +4.411831143951246 0 0 +4.552419407792404 0 0 +4.69722531932773 0 0 +4.846375407792818 0 0 +$EndNodes +$Elements +3 102 1 102 +0 1 15 1 +1 1 +0 2 15 1 +2 2 +1 1 1 100 +3 1 3 +4 3 4 +5 4 5 +6 5 6 +7 6 7 +8 7 8 +9 8 9 +10 9 10 +11 10 11 +12 11 12 +13 12 13 +14 13 14 +15 14 15 +16 15 16 +17 16 17 +18 17 18 +19 18 19 +20 19 20 +21 20 21 +22 21 22 +23 22 23 +24 23 24 +25 24 25 +26 25 26 +27 26 27 +28 27 28 +29 28 29 +30 29 30 +31 30 31 +32 31 32 +33 32 33 +34 33 34 +35 34 35 +36 35 36 +37 36 37 +38 37 38 +39 38 39 +40 39 40 +41 40 41 +42 41 42 +43 42 43 +44 43 44 +45 44 45 +46 45 46 +47 46 47 +48 47 48 +49 48 49 +50 49 50 +51 50 51 +52 51 52 +53 52 53 +54 53 54 +55 54 55 +56 55 56 +57 56 57 +58 57 58 +59 58 59 +60 59 60 +61 60 61 +62 61 62 +63 62 63 +64 63 64 +65 64 65 +66 65 66 +67 66 67 +68 67 68 +69 68 69 +70 69 70 +71 70 71 +72 71 72 +73 72 73 +74 73 74 +75 74 75 +76 75 76 +77 76 77 +78 77 78 +79 78 79 +80 79 80 +81 80 81 +82 81 82 +83 82 83 +84 83 84 +85 84 85 +86 85 86 +87 86 87 +88 87 88 +89 88 89 +90 89 90 +91 90 91 +92 91 92 +93 92 93 +94 93 94 +95 94 95 +96 95 96 +97 96 97 +98 97 98 +99 98 99 +100 99 100 +101 100 101 +102 101 2 +$EndElements diff --git a/dG3D/benchmarks/torchUniaxial/energy.csv b/dG3D/benchmarks/torchUniaxial/energy.csv deleted file mode 100644 index a3a6a231c1c18b7cc6ac6129d81f4107272871c3..0000000000000000000000000000000000000000 --- a/dG3D/benchmarks/torchUniaxial/energy.csv +++ /dev/null @@ -1,51 +0,0 @@ -Time;Kinetic;Deformation;Plastic;Wext;Damage;Total;LocalPathFollowing -0.02;0;4.318620839323089e-09;0;4.314688148729315e-09;0;4.318620839323089e-09;0 -0.04;0;2.393946471966429e-08;0;2.057943869046618e-08;0;2.393946471966429e-08;0 -0.06;0;5.520438342373303e-08;0;5.088455208859447e-08;0;5.520438342373303e-08;0 -0.08;0;9.529585823564148e-08;0;9.298501000726851e-08;0;9.529585823564148e-08;0 -0.1;0;1.480737699551332e-07;0;1.462222096025636e-07;0;1.480737699551332e-07;0 -0.12;0;2.12827768499092e-07;0;2.110093881293272e-07;0;2.12827768499092e-07;0 -0.14;0;2.884983515733784e-07;0;2.872811502390115e-07;0;2.884983515733784e-07;0 -0.16;0;3.727835075425902e-07;0;3.745478853075598e-07;0;3.727835075425902e-07;0 -0.18;0;4.625052482803622e-07;0;4.718432116852137e-07;0;4.625052482803622e-07;0 -0.2;0;5.523721595318752e-07;0;5.776171597055694e-07;0;5.523721595318752e-07;0 -0.22;0;6.372482475364684e-07;0;6.897574438020548e-07;0;6.372482475364684e-07;0 -0.24;0;7.191121019185594e-07;0;8.063937576500099e-07;0;7.191121019185594e-07;0 -0.26;0;7.987195878739341e-07;0;9.263317342484775e-07;0;7.987195878739341e-07;0 -0.28;0;8.770785347549719e-07;0;1.048776690971052e-06;0;8.770785347549719e-07;0 -0.3;0;9.54831136318696e-07;0;1.173215209914747e-06;0;9.54831136318696e-07;0 -0.32;0;1.0320216167506e-06;0;1.299279840881292e-06;0;1.0320216167506e-06;0 -0.34;0;1.107860675399628e-06;0;1.426626684448569e-06;0;1.107860675399628e-06;0 -0.36;0;1.184660780373776e-06;0;1.555051745092817e-06;0;1.184660780373776e-06;0 -0.3800000000000001;0;1.261769231286171e-06;0;1.684478170417301e-06;0;1.261769231286171e-06;0 -0.4000000000000001;0;1.338486224225571e-06;0;1.814771854430847e-06;0;1.338486224225571e-06;0 -0.4200000000000001;0;1.41529865339058e-06;0;1.945806670480705e-06;0;1.41529865339058e-06;0 -0.4400000000000001;0;1.492222682881903e-06;0;2.077498154100986e-06;0;1.492222682881903e-06;0 -0.4600000000000001;0;1.569802825928822e-06;0;2.209797290951658e-06;0;1.569802825928822e-06;0 -0.4800000000000001;0;1.647539482388799e-06;0;2.342663924904069e-06;0;1.647539482388799e-06;0 -0.5000000000000001;0;1.725573547755749e-06;0;2.476048118340639e-06;0;1.725573547755749e-06;0 -0.5200000000000001;0;1.623680730637786e-06;0;2.410552239260066e-06;0;1.623680730637786e-06;0 -0.5400000000000001;0;1.53381561044029e-06;0;2.347507140984796e-06;0;1.53381561044029e-06;0 -0.5600000000000002;0;1.445515568920446e-06;0;2.286741115796246e-06;0;1.445515568920446e-06;0 -0.5800000000000002;0;1.339839207672363e-06;0;2.228691351557657e-06;0;1.339839207672363e-06;0 -0.6000000000000002;0;1.233631390614358e-06;0;2.173860258537028e-06;0;1.233631390614358e-06;0 -0.6200000000000002;0;1.141545095446912e-06;0;2.122095811079726e-06;0;1.141545095446912e-06;0 -0.6400000000000002;0;1.051351731813977e-06;0;2.073187176838482e-06;0;1.051351731813977e-06;0 -0.6600000000000003;0;9.642358873636089e-07;0;2.027158557743005e-06;0;9.642358873636089e-07;0 -0.6800000000000003;0;8.81795116024128e-07;0;1.983969963429072e-06;0;8.81795116024128e-07;0 -0.7000000000000003;0;8.016255511848183e-07;0;1.943598860007707e-06;0;8.016255511848183e-07;0 -0.7200000000000003;0;7.241247910338455e-07;0;1.906069621736648e-06;0;7.241247910338455e-07;0 -0.7400000000000003;0;6.495389457120947e-07;0;1.871392004560929e-06;0;6.495389457120947e-07;0 -0.7600000000000003;0;5.778990473257901e-07;0;1.839569192154978e-06;0;5.778990473257901e-07;0 -0.7800000000000004;0;5.093041913577288e-07;0;1.810600917901329e-06;0;5.093041913577288e-07;0 -0.8000000000000004;0;4.441214290210536e-07;0;1.784473695523064e-06;0;4.441214290210536e-07;0 -0.8200000000000004;0;3.82150798121301e-07;0;1.761168129559884e-06;0;3.82150798121301e-07;0 -0.8400000000000004;0;3.236879947936012e-07;0;1.740659921255494e-06;0;3.236879947936012e-07;0 -0.8600000000000004;0;2.683128814653851e-07;0;1.722926415763098e-06;0;2.683128814653851e-07;0 -0.8800000000000004;0;2.156285904789274e-07;0;1.707967954546524e-06;0;2.156285904789274e-07;0 -0.9000000000000005;0;1.656360196386882e-07;0;1.695797170315308e-06;0;1.656360196386882e-07;0 -0.9200000000000005;0;1.18564046959287e-07;0;1.6864200082876e-06;0;1.18564046959287e-07;0 -0.9400000000000005;0;7.447072052203952e-08;0;1.679833054254442e-06;0;7.447072052203952e-08;0 -0.9600000000000005;0;3.337238231144813e-08;0;1.676029644478894e-06;0;3.337238231144813e-08;0 -0.9800000000000005;0;-4.536709570066614e-09;0;1.674994202590472e-06;0;-4.536709570066614e-09;0 -1;0;-3.949138432782138e-08;0;1.676710894178179e-06;0;-3.949138432782138e-08;0 diff --git a/dG3D/benchmarks/torchUniaxial/macro_cpp.py b/dG3D/benchmarks/torchUniaxial/macro_cpp.py index 9b0cccf444612caea70d19b351544a8b18ba79a7..af05a81a2b1717cd4ddf702bdbe94527b7d21860 100755 --- a/dG3D/benchmarks/torchUniaxial/macro_cpp.py +++ b/dG3D/benchmarks/torchUniaxial/macro_cpp.py @@ -82,7 +82,7 @@ mysolver.addMaterialLaw(macromat1) #mysolver.addMaterialLaw(pertmacromat1) mysolver.Scheme(soltype) mysolver.Solver(sol) -mysolver.snlData(nstep,ftime,tol) +mysolver.snlData(nstep,ftime,tol,tol/100.) # boundary condition mysolver.displacementBC("Face",nfield1,2,0.0) diff --git a/dG3D/src/dG3Dpy.i b/dG3D/src/dG3Dpy.i index 9a44dcec1c706f15381c2b6f98cb73627d45a5f3..8efa466c19c044c16712df712d9ed713c76db442 100644 --- a/dG3D/src/dG3Dpy.i +++ b/dG3D/src/dG3Dpy.i @@ -4,9 +4,7 @@ #else %module dG3Dpy #endif -%include std_string.i -%include std_vector.i -%include std_map.i + %include nlmechsolpy.i