diff --git a/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.cpp b/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.cpp index ce957ed7663a89c7ea84903197e941480892fe37..f9dfcc4d3f245dadcc7edfb03a4247d47f172f80 100644 --- a/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.cpp +++ b/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.cpp @@ -53,6 +53,22 @@ IPElecMagGenericThermoMech& IPElecMagGenericThermoMech::operator=(const IPVariab return *this; } +double IPElecMagGenericThermoMech::get(const int comp) const +{ + double val=IPVariable::get(comp); + if(val==0.) + val = _ipThermoMech->get(comp); + return val; +} + +double & IPElecMagGenericThermoMech::getRef(const int comp) +{ + double & val=IPVariable::getRef(comp); + if(val==0.) + val = _ipThermoMech->getRef(comp); + return val; +} + void IPElecMagGenericThermoMech::restart() { IPVariable::restart(); diff --git a/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.h b/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.h index b47cf9818f5a2bb3af746674dbd55bbfb92af027..d330f03eb6b8356168d374dd8fae67a062521149 100644 --- a/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.h +++ b/NonLinearSolver/internalPoints/ipElecMagGenericThermoMech.h @@ -56,5 +56,7 @@ public: } _ipThermoMech= (dynamic_cast<IPGenericTM*>((ipThermoMech.clone()))); } + virtual double get(const int comp) const; + virtual double & getRef(const int comp); }; #endif //IPELECMAGGENERICTHERMOMECH_H_ diff --git a/NonLinearSolver/internalPoints/ipElecMagInductor.cpp b/NonLinearSolver/internalPoints/ipElecMagInductor.cpp index 1c370ed9cda26ca214f84a8db1cf3dce270f8df5..d85e16333bd7ccefb2095c6f3f54183b9542cbe5 100644 --- a/NonLinearSolver/internalPoints/ipElecMagInductor.cpp +++ b/NonLinearSolver/internalPoints/ipElecMagInductor.cpp @@ -51,6 +51,16 @@ double IPElecMagInductor::defoEnergy() const return IPElecMagGenericThermoMech::defoEnergy(); } +double IPElecMagInductor::get(const int comp) const +{ + return IPElecMagGenericThermoMech::get(comp); +} + +double & IPElecMagInductor::getRef(const int comp) +{ + return IPElecMagGenericThermoMech::getRef(comp); +} + void IPElecMagInductor::restart() { IPElecMagGenericThermoMech::restart(); diff --git a/NonLinearSolver/internalPoints/ipElecMagInductor.h b/NonLinearSolver/internalPoints/ipElecMagInductor.h index bda80da9b9754711945809579d641e5c173cb14c..84b201deb18d376763b9c4e4fb3e1a04f7acec78 100644 --- a/NonLinearSolver/internalPoints/ipElecMagInductor.h +++ b/NonLinearSolver/internalPoints/ipElecMagInductor.h @@ -30,6 +30,8 @@ public: virtual void restart(); virtual IPVariable* clone() const {return new IPElecMagInductor(*this);} virtual double defoEnergy() const; + virtual double get(const int comp) const; + virtual double & getRef(const int comp); }; #endif //IPELECMAGINDUCTOR_H_ diff --git a/NonLinearSolver/internalPoints/ipGenericTM.cpp b/NonLinearSolver/internalPoints/ipGenericTM.cpp index 172fe9037c21b245aaaf3b236e03d99fff7e6862..0f7bab22b9526fd2414d47c315dccc624e254440 100644 --- a/NonLinearSolver/internalPoints/ipGenericTM.cpp +++ b/NonLinearSolver/internalPoints/ipGenericTM.cpp @@ -58,4 +58,20 @@ void IPGenericTM::restart() restartManager::restart(referenceF); restartManager::restart(FthI0); restartManager::restart(_thermalEnergy); +} + +double IPGenericTM::get(const int comp) const +{ + double val=IPVariable::get(comp); + if(val==0.) + val = _ipMeca->get(comp); + return val; +} + +double & IPGenericTM::getRef(const int comp) +{ + double & val=IPVariable::getRef(comp); + if(val==0.) + val = _ipMeca->getRef(comp); + return val; } \ No newline at end of file diff --git a/NonLinearSolver/internalPoints/ipGenericTM.h b/NonLinearSolver/internalPoints/ipGenericTM.h index f817833c85f342088bfbcea325109219939bd61f..7b8c52a4823024c408235e55de8be48e3b57fbea 100644 --- a/NonLinearSolver/internalPoints/ipGenericTM.h +++ b/NonLinearSolver/internalPoints/ipGenericTM.h @@ -58,6 +58,8 @@ public: const STensor3 & getConstRefToFthI() const { return FthI0;} STensor3 & getRefToFthI(){ return FthI0;} + virtual double get(const int comp) const; + virtual double & getRef(const int comp); }; #endif //IPGENERICTM_H_ diff --git a/NonLinearSolver/internalPoints/ipLinearElecMagInductor.cpp b/NonLinearSolver/internalPoints/ipLinearElecMagInductor.cpp index efed5d3e27de39131848717523f21c0662154238..5143cabc931dff80c49ad925f29b333befd1f80c 100644 --- a/NonLinearSolver/internalPoints/ipLinearElecMagInductor.cpp +++ b/NonLinearSolver/internalPoints/ipLinearElecMagInductor.cpp @@ -43,6 +43,16 @@ double IPLinearElecMagInductor::defoEnergy() const return IPLinearElecMagTherMech::defoEnergy(); } +double IPLinearElecMagInductor::get(const int comp) const +{ + return IPLinearElecMagTherMech::get(comp); +} + +double & IPLinearElecMagInductor::getRef(const int comp) +{ + return IPLinearElecMagTherMech::getRef(comp); +} + void IPLinearElecMagInductor::restart() { IPLinearElecMagTherMech::restart(); diff --git a/NonLinearSolver/internalPoints/ipLinearElecMagInductor.h b/NonLinearSolver/internalPoints/ipLinearElecMagInductor.h index b8af67684f83b6b4d0d5c11b7322b453b1bdc9a0..94c587a72768c46f0e497b53598ab8352ed77c94 100644 --- a/NonLinearSolver/internalPoints/ipLinearElecMagInductor.h +++ b/NonLinearSolver/internalPoints/ipLinearElecMagInductor.h @@ -25,6 +25,8 @@ public: virtual void restart(); virtual IPVariable* clone() const {return new IPLinearElecMagInductor(*this);} virtual double defoEnergy() const; + virtual double get(const int comp) const; + virtual double & getRef(const int comp); private: IPLinearElecMagInductor(); }; diff --git a/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.cpp b/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.cpp index 219cbc68dc82e227ef5a1908d6752dc6f9fc74be..221e4ca7e6ab36d7d8833160e6fb78505dad0d84 100644 --- a/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.cpp +++ b/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.cpp @@ -29,3 +29,12 @@ void IPLinearElecMagTherMech::restart() { IPLinearElecTherMech::restart(); } +double IPLinearElecMagTherMech::get(const int comp) const +{ + return IPLinearElecTherMech::get(comp); +} + +double & IPLinearElecMagTherMech::getRef(const int comp) +{ + return IPLinearElecTherMech::getRef(comp); +} \ No newline at end of file diff --git a/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.h b/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.h index 0efffa8ef253592ad7b176f2c2774051521ac283..85ba82fa9a4f1eda7d8382f6c14196e4b45312b1 100644 --- a/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.h +++ b/NonLinearSolver/internalPoints/ipLinearElecMagTherMech.h @@ -26,6 +26,8 @@ public: return new IPLinearElecMagTherMech(*this); } virtual void restart(); + virtual double get(const int comp) const; + virtual double & getRef(const int comp); }; #endif // IPLinearElecMagTherMech_H_ diff --git a/NonLinearSolver/internalPoints/ipLinearElecTherMech.cpp b/NonLinearSolver/internalPoints/ipLinearElecTherMech.cpp index 17d5b6d99abdec424509385009404fa9e608fa45..f4a8ed3dc40f58ccf7556ba893ea28c3b579f785 100644 --- a/NonLinearSolver/internalPoints/ipLinearElecTherMech.cpp +++ b/NonLinearSolver/internalPoints/ipLinearElecTherMech.cpp @@ -29,3 +29,12 @@ void IPLinearElecTherMech::restart() IPVariableMechanics::restart(); restartManager::restart( _elasticEnergy); } +double IPLinearElecTherMech::get(const int comp) const +{ + return IPLinearThermoMechanics::get(comp); +} + +double & IPLinearElecTherMech::getRef(const int comp) +{ + return IPLinearThermoMechanics::getRef(comp); +} diff --git a/NonLinearSolver/internalPoints/ipLinearElecTherMech.h b/NonLinearSolver/internalPoints/ipLinearElecTherMech.h index 218b580e483d1d396bb2c6c8acbccfba678fb980..64922fdda48bc5e21da1ce57286ad5be3c4593d2 100644 --- a/NonLinearSolver/internalPoints/ipLinearElecTherMech.h +++ b/NonLinearSolver/internalPoints/ipLinearElecTherMech.h @@ -26,6 +26,8 @@ public: virtual IPVariable* clone() const {return new IPLinearElecTherMech(*this);}; //virtual void restart(){return IPLinearThermoMechanics::restart();} virtual void restart(); + virtual double get(const int comp) const; + virtual double &getRef(const int comp); }; #endif // IPLinearElecTherMech_H_ diff --git a/NonLinearSolver/internalPoints/ipLinearThermoMechanics.cpp b/NonLinearSolver/internalPoints/ipLinearThermoMechanics.cpp index 40054cc675e237255627d282360d573f3893e4bc..4e2c430f1c1fbad2696d9c5ccfeb8e4f63244282 100644 --- a/NonLinearSolver/internalPoints/ipLinearThermoMechanics.cpp +++ b/NonLinearSolver/internalPoints/ipLinearThermoMechanics.cpp @@ -45,6 +45,14 @@ double IPLinearThermoMechanics::getThermalEnergy() const return _fracEnergy; }*/ +double IPLinearThermoMechanics::get(const int comp) const +{ + return IPVariableMechanics::get(comp); +} +double & IPLinearThermoMechanics::getRef(const int comp) +{ + return IPVariableMechanics::getRef(comp); +} void IPLinearThermoMechanics::restart() { diff --git a/NonLinearSolver/internalPoints/ipLinearThermoMechanics.h b/NonLinearSolver/internalPoints/ipLinearThermoMechanics.h index 4babe78f1a241caad23354108e0a90af09f96930..8b24febb9115707fcc9427d07cf485cd9e10baea 100644 --- a/NonLinearSolver/internalPoints/ipLinearThermoMechanics.h +++ b/NonLinearSolver/internalPoints/ipLinearThermoMechanics.h @@ -26,6 +26,8 @@ class IPLinearThermoMechanics : public IPVariableMechanics virtual void restart(); virtual IPVariable* clone() const {return new IPLinearThermoMechanics(*this);}; virtual double getConstRefToFractureEnergy() const {return _fracEnergy;}; + virtual double get(const int comp) const; + virtual double & getRef(const int comp); }; #endif // IPLINEARTHERMOMECHANICS_H_ diff --git a/NonLinearSolver/materialLaw/mlawElecMagGenericThermoMech.cpp b/NonLinearSolver/materialLaw/mlawElecMagGenericThermoMech.cpp index dcf9e7ce29f166d8fda56c2ed39d0aaadd0085c3..bab9ae1bec4ddefb6d6ab9d775dd374ad0c9072a 100644 --- a/NonLinearSolver/materialLaw/mlawElecMagGenericThermoMech.cpp +++ b/NonLinearSolver/materialLaw/mlawElecMagGenericThermoMech.cpp @@ -548,13 +548,6 @@ void mlawElecMagGenericThermoMech::constitutive( } } - if(applyReferenceF) - { - // in weak EM problem with Fn = I - // d*dFn = 0 always because Fn is constant - STensorOperation::zero(dFTotdFn); - } - //from HERE NO MORE applyReferenceFq // Magnetic permeability tensor from constitutive model diff --git a/dG3D/src/dG3DIPVariable.cpp b/dG3D/src/dG3DIPVariable.cpp index 27a28a223eb0aeca22a36c18a250329dd383b584..fae3f2dd4e7bf6f65796f9e5994e60ff2acf5f7e 100644 --- a/dG3D/src/dG3DIPVariable.cpp +++ b/dG3D/src/dG3DIPVariable.cpp @@ -4743,10 +4743,12 @@ LinearElecMagTherMechDG3DIPVariable& LinearElecMagTherMechDG3DIPVariable::operat return *this; } -double LinearElecMagTherMechDG3DIPVariable::get(const int i) const +double LinearElecMagTherMechDG3DIPVariable::get(const int comp) const { - - return ElecMagTherMechDG3DIPVariableBase::get(i); + double val =ElecMagTherMechDG3DIPVariableBase::get(comp); + if (val == 0) + val = _linearEMTMIP.get(comp); + return val; } double & LinearElecMagTherMechDG3DIPVariable::getRef(const int i) @@ -4797,7 +4799,11 @@ LinearElecMagInductorDG3DIPVariable & LinearElecMagInductorDG3DIPVariable::opera double LinearElecMagInductorDG3DIPVariable::get(const int comp) const { - return ElecMagTherMechDG3DIPVariableBase::get(comp); + double val =ElecMagTherMechDG3DIPVariableBase::get(comp); + if (val == 0) + val = _linearEMInductor.get(comp); + return val; + } double & LinearElecMagInductorDG3DIPVariable::getRef(const int comp) @@ -5079,6 +5085,11 @@ double ElecMagGenericThermoMechanicsDG3DIPVariable::get(const int i) const return val; } +double & ElecMagGenericThermoMechanicsDG3DIPVariable::getRef(const int i) +{ + return ElecMagTherMechDG3DIPVariableBase::getRef(i); +} + double ElecMagGenericThermoMechanicsDG3DIPVariable::defoEnergy() const { return getConstRefToIpThermoMech().defoEnergy(); diff --git a/dG3D/src/dG3DIPVariable.h b/dG3D/src/dG3DIPVariable.h index 645f7e272b9c795fcd9092a80373e7f8790641f4..0812720733f9f863616c727e36014856687d200e 100644 --- a/dG3D/src/dG3DIPVariable.h +++ b/dG3D/src/dG3DIPVariable.h @@ -5005,6 +5005,7 @@ public: _elecMagGenericThermoMechIP = NULL; } virtual double get(const int i) const; + virtual double & getRef(const int i); virtual double defoEnergy() const; virtual double getInternalEnergyExtraDofDiffusion() const {return _elecMagGenericThermoMechIP->getThermalEnergy();}; virtual double plasticEnergy() const;