Skip to content
Snippets Groups Projects
Commit 6fe00242 authored by vinugholap@gmail.com's avatar vinugholap@gmail.com
Browse files

Corrections in stiff matrix to use updated var names

parent fdcefd9b
No related branches found
No related tags found
3 merge requests!332Bug fix: Correct location and data type for emFieldSource and its derivatives,...,!329Vinayak,!328Vinayak
......@@ -817,6 +817,7 @@ void dG3DForceBulk::get(MElement *ele,int npts,IntPt *GP,fullVector<double> &vFo
const int nbFFRow = nlspace->getNumShapeFunctions(ele,curveFieldIndex); // number of shape functinon for curveFieldIndex in curlVals and CurlcurlVals
const int nbFFTotalLastRow = nlspace->getShapeFunctionsIndex(ele,curveFieldIndex); // the position of the first element of shape functinon for curveFieldIndex in curlVals and CurlcurlVals
// SourceVectorField = -fluxD
SVector3 w(0.0);
if (getConstitutiveCurlAccountFieldSource())
{
......@@ -845,7 +846,7 @@ void dG3DForceBulk::get(MElement *ele,int npts,IntPt *GP,fullVector<double> &vFo
}
}
}
vFor.print("force");
//vFor.print("force");
}
void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double> &mStiff) const
......@@ -1729,7 +1730,6 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
}
}
}
std::cout << mStiff.operator()(32,25) << std::endl;
}
}
......@@ -1776,21 +1776,15 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
const STensor3 &dHdA = ipv->getConstRefTodVectorFielddVectorPotential()[curlField][curlField2];
const STensor3 &dHdB = ipv->getConstRefTodVectorFielddVectorCurl()[curlField][curlField2];
// only dFluxDdA, dFluxDdB contributions
const STensor3 &dFluxdVectorCurl = ipv->getConstRefTodFluxdVectorCurl()[1][curlField];
const STensor3 &dFluxdVectorPotential = ipv->getConstRefTodFluxdVectorPotential()[1][curlField];
/*STensor3 dSourceVectorFielddB(0.0);
STensor3 dMechFieldSourcedB(0.0);
STensor3 dSourceVectorFielddVectorCurl(0.0);
STensor3 dSourceVectorFielddVectorPotential(0.0);
if (getConstitutiveCurlAccountFieldSource())
{
dSourceVectorFielddB += ipv->getConstRefTodSourceVectorFielddVectorCurl()[curlField][curlField2];
dSourceVectorFielddVectorCurl += ipv->getConstRefTodSourceVectorFielddVectorCurl()[curlField][curlField2];
dSourceVectorFielddVectorPotential += ipv->getConstRefTodSourceVectorFielddVectorPotential()[curlField][curlField2];
}
if (getConstitutiveCurlAccountMecaSource())
{
dMechFieldSourcedB += ipv->getConstRefTodMechanicalFieldSourcedVectorCurl()[curlField][curlField2];
}*/
for (unsigned int j = 0; j < numEdgeShapeFuncRow; ++j)
{
......@@ -1813,16 +1807,16 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
dHdB.operator()(m, n) *
CurlcurlVals[k + numEdgeShapeFuncTotalLastCol][n]);
mStiff(j + numEdgeShapeFuncTotalLastRow + numStandardDof,
k + numEdgeShapeFuncTotalLastCol + numStandardDof) +=
k + numEdgeShapeFuncTotalLastCol + numStandardDof) -=
getConstitutiveCurlEqRatio() * ratio *
(curlVals[j + numEdgeShapeFuncTotalLastRow][m] *
dFluxdVectorPotential.operator()(m, n) *
dSourceVectorFielddVectorPotential.operator()(m, n) *
curlVals[k + numEdgeShapeFuncTotalLastCol][n]);
mStiff(j + numEdgeShapeFuncTotalLastRow + numStandardDof,
k + numEdgeShapeFuncTotalLastCol + numStandardDof) +=
k + numEdgeShapeFuncTotalLastCol + numStandardDof) -=
getConstitutiveCurlEqRatio() * ratio *
(curlVals[j + numEdgeShapeFuncTotalLastRow][m] *
dFluxdVectorCurl.operator()(m, n) *
dSourceVectorFielddVectorCurl.operator()(m, n) *
CurlcurlVals[k + numEdgeShapeFuncTotalLastCol][n]);
}
}
......@@ -1890,17 +1884,12 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
const SVector3 &dVectorFielddNonLocalVar = ipv->getConstRefTodVectorFielddNonLocalVariable()[curlField][nlk];
/*SVector3 dSourceVectorFielddNonLocalVar(0.0);
SVector3 dMechFieldSourcedNonLocalVar(0.0);
SVector3 dSourceVectorFielddNonLocalVar(0.0);
if (getConstitutiveCurlAccountFieldSource())
{
dSourceVectorFielddNonLocalVar += ipv->getConstRefTodSourceVectorFielddNonLocalVariable()[curlField][nlk];
}
if (getConstitutiveCurlAccountMecaSource())
{
dMechFieldSourcedNonLocalVar += ipv->getConstRefTodMechanicalFieldSourcedNonLocalVariable()[curlField][nlk];
}*/
for (unsigned int j = 0; j < numEdgeShapeFuncRow; ++j)
for (unsigned int k = 0; k < nbFFCol; ++k)
......@@ -1931,24 +1920,18 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
const unsigned int nbFFCol = nlspace->getNumShapeFunctions(ele, IndexField);
const unsigned int nbFFTotalLastCol = nlspace->getShapeFunctionsIndex(ele, IndexField);
// dHdV, dHdT, dHdGradV, dHdGradT
const SVector3 &dVectorFielddExtraDofField = ipv->getConstRefTodVectorFielddExtraDofField()[curlField][extraDOFField];
const STensor3 &dVectorFielddGradExtraDofField = ipv->getConstRefTodVectorFielddGradExtraDofField()[curlField][extraDOFField];
// only dFluxDdField, dFluxDdGradField contributions
const SVector3 &dFluxdExtraDofField = ipv->getConstRefTodFluxdField()[1][extraDOFField];
const STensor3 &dFluxdGradExtraDofField = ipv->getConstRefTodFluxdGradField()[1][extraDOFField];
/*SVector3 dSourceVectorFielddExtraDofField(0.0);
SVector3 dMechFieldSourcedExtraDofField(0.0);
SVector3 dSourceVectorFielddExtraDofField(0.0);
STensor3 dSourceVectorFielddGradExtraDofField(0.0);
if (getConstitutiveCurlAccountFieldSource())
{
dSourceVectorFielddExtraDofField += ipv->getConstRefTodSourceVectorFielddExtraDofField()[curlField][extraDOFField];
dSourceVectorFielddGradExtraDofField += ipv->getConstRefTodSourceVectorFielddGradExtraDofField()[curlField][extraDOFField];
}
if (getConstitutiveCurlAccountMecaSource())
{
dMechFieldSourcedExtraDofField += ipv->getConstRefTodMechanicalFieldSourcedExtraDofField()[curlField][extraDOFField];
}*/
for (unsigned int j = 0; j < numEdgeShapeFuncRow; ++j)
for (unsigned int k = 0; k < nbFFCol; ++k)
......@@ -1960,7 +1943,7 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
CurlcurlVals[j+numEdgeShapeFuncTotalLastRow][m] *
Vals[k+nbFFTotalLastCol]);
mStiff(j+numEdgeShapeFuncTotalLastRow+numStandardDof,k+nbFFTotalLastCol) -= getConstitutiveCurlEqRatio() * ratio *
(dFluxdExtraDofField.operator()(m) *
(dSourceVectorFielddExtraDofField.operator()(m) *
curlVals[j+numEdgeShapeFuncTotalLastRow][m] *
Vals[k+nbFFTotalLastCol]);
for (unsigned int n = 0; n < 3; ++n)
......@@ -1971,7 +1954,7 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
Grads[k+nbFFTotalLastCol][n]);
mStiff(j+numEdgeShapeFuncTotalLastRow+numStandardDof,k+nbFFTotalLastCol) -= getConstitutiveCurlEqRatio() * ratio *
(curlVals[j+numEdgeShapeFuncTotalLastRow][m] *
dFluxdGradExtraDofField.operator()(m,n) *
dSourceVectorFielddGradExtraDofField.operator()(m,n) *
Grads[k+nbFFTotalLastCol][n]);
}
}
......@@ -1981,7 +1964,7 @@ void dG3DStiffnessBulk::get(MElement *ele,int npts,IntPt *GP,fullMatrix<double>
}
}
}
mStiff.print("bulk");
//mStiff.print("bulk");
} // end if sym
else
printf("not implemented\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment