diff --git a/src/TACSAssembler.cpp b/src/TACSAssembler.cpp index 792ade7e..9348a114 100644 --- a/src/TACSAssembler.cpp +++ b/src/TACSAssembler.cpp @@ -4909,8 +4909,7 @@ void TACSAssembler::addXptSens(TacsScalar coef, int numFuncs, */ void TACSAssembler::addSVSens(TacsScalar alpha, TacsScalar beta, TacsScalar gamma, int numFuncs, - TACSFunction **funcs, TACSBVec **dfdu, - const bool applyBCs) { + TACSFunction **funcs, TACSBVec **dfdu) { // First check if this is the right assembly object for (int k = 0; k < numFuncs; k++) { if (funcs[k] && this != funcs[k]->getAssembler()) { @@ -4978,9 +4977,6 @@ void TACSAssembler::addSVSens(TacsScalar alpha, TacsScalar beta, for (int k = 0; k < numFuncs; k++) { if (funcs[k]) { dfdu[k]->endSetValues(TACS_ADD_VALUES); - if (applyBCs) { - dfdu[k]->applyBCs(bcMap); - } } } } diff --git a/src/TACSAssembler.h b/src/TACSAssembler.h index fbbe567e..924622af 100644 --- a/src/TACSAssembler.h +++ b/src/TACSAssembler.h @@ -271,8 +271,7 @@ class TACSAssembler : public TACSObject { void addDVSens(TacsScalar coef, int numFuncs, TACSFunction **funcs, TACSBVec **dfdx); void addSVSens(TacsScalar alpha, TacsScalar beta, TacsScalar gamma, - int numFuncs, TACSFunction **funcs, TACSBVec **dfdu, - const bool applyBCs = true); + int numFuncs, TACSFunction **funcs, TACSBVec **dfdu); void addAdjointResProducts(TacsScalar scale, int numAdjoints, TACSBVec **adjoint, TACSBVec **dfdx, const TacsScalar lambda = 1.0); diff --git a/tacs/TACS.pyx b/tacs/TACS.pyx index 37ab3f1c..983fec69 100644 --- a/tacs/TACS.pyx +++ b/tacs/TACS.pyx @@ -2286,7 +2286,7 @@ cdef class Assembler: return def addSVSens(self, funclist, dfdulist, double alpha=1.0, - double beta=0.0, double gamma=0.0, bool applyBCs=True): + double beta=0.0, double gamma=0.0): """ Evaluate the derivative of the function w.r.t. the state @@ -2316,7 +2316,7 @@ cdef class Assembler: dfdu[i] = (dfdulist[i]).getBVecPtr() # Evaluate the derivative of the functions - self.ptr.addSVSens(alpha, beta, gamma, num_funcs, funcs, dfdu, applyBCs) + self.ptr.addSVSens(alpha, beta, gamma, num_funcs, funcs, dfdu) free(funcs) free(dfdu) diff --git a/tacs/cpp_headers/TACS.pxd b/tacs/cpp_headers/TACS.pxd index 3128a293..d3649a2e 100644 --- a/tacs/cpp_headers/TACS.pxd +++ b/tacs/cpp_headers/TACS.pxd @@ -396,7 +396,7 @@ cdef extern from "TACSAssembler.h": TACSBVec **dfdx) void addSVSens(double alpha, double beta, double gamma, int numFuncs, TACSFunction **funcs, - TACSBVec **fuSens, bool applyBCs) + TACSBVec **fuSens) void addAdjointResProducts(double scale, int numAdjoints, TACSBVec **adjoint, TACSBVec **dfdx, TacsScalar loadScale) diff --git a/tacs/problems/static.py b/tacs/problems/static.py index 19ee8ff5..bc33ff10 100644 --- a/tacs/problems/static.py +++ b/tacs/problems/static.py @@ -1224,7 +1224,7 @@ def evalFunctionsSens(self, funcsSens, evalFuncs=None): # Next we will solve all the adjoints # Set adjoint rhs - self.addSVSens(evalFuncs, dIdus, applyBCs=False) + self.addSVSens(evalFuncs, dIdus) adjointRHSTime = time.time() for i, f in enumerate(evalFuncs): adjointStartTime[f] = time.time() @@ -1288,7 +1288,7 @@ def evalFunctionsSens(self, funcsSens, evalFuncs=None): ) self._pp("+--------------------------------------------------+") - def addSVSens(self, evalFuncs, svSensList, applyBCs=False): + def addSVSens(self, evalFuncs, svSensList): """ Add the state variable partial sensitivity to the ADjoint RHS for given evalFuncs @@ -1318,7 +1318,7 @@ def addSVSens(self, evalFuncs, svSensList, applyBCs=False): svSensBVecList = svSensList self.assembler.addSVSens( - funcHandles, svSensBVecList, self.alpha, self.beta, self.gamma, applyBCs + funcHandles, svSensBVecList, self.alpha, self.beta, self.gamma ) # Update from the BVec values, if the input was a numpy array