42 #ifndef ___MATVECASS_H__INCLUDED___
43 #define ___MATVECASS_H__INCLUDED___
45 #if GRADIENT_DEBUG > 0 && HAVE_FINITE == 1
66 dVal = vh.dGetCoef(iRow);
69 template <index_type N_rows>
72 v(i + 1) = vh.dGetCoef(iRow + i);
80 template <index_type N_SIZE>
93 template <index_type N_rows>
95 for (
integer i = 0; i < v.iGetNumRows(); ++i) {
111 template <
typename T>
122 iSubRow = WorkVec.iGetSize();
127 WorkVec.Resize(iSubRow);
135 template <
typename T>
143 enum mode_t mode = RESET) {
148 pElem->AssRes(WorkVec_grad, dCoef, XCurr_grad, XPrimeCurr_grad, func);
151 template <
typename T>
157 enum mode_t mode = RESET) {
161 pElem->InitialAssRes(WorkVec_grad, XCurr_grad, func);
165 WorkVec.Resize(++iSubRow);
168 #if GRADIENT_DEBUG > 0 && HAVE_FINITE == 1
169 if (!std::isfinite(dCoef)) {
170 silent_cerr(
"PutItem(" << iSubRow <<
", " << iRow <<
", " << dCoef <<
")" << std::endl);
174 WorkVec.PutItem(iSubRow, iRow, dCoef);
177 template <index_type N_rows>
184 #if GRADIENT_DEBUG > 0 && HAVE_FINITE == 1
185 if (!std::isfinite(v(i + 1))) {
186 silent_cerr(
"PutItem(" << iSubRow + 1 <<
", " << iFirstRow + i <<
", " << v(i + 1) <<
")" << std::endl);
190 WorkVec.PutItem(++iSubRow, iFirstRow + i, v(i + 1));
199 template <index_type N_SIZE>
208 WorkMat.ResizeReset(iNextItem, 0);
209 WorkMat.PutItem(1, 1, 1, 0.);
213 iNextItem = WorkMat.iGetNumRows() + 1;
222 template <
typename T>
230 enum mode_t mode = RESET) {
238 pDofMap->
Reset(func);
241 pElem->AssRes(WorkMat_grad, dCoef, XCurr_grad, XPrimeCurr_grad, func);
244 template <
typename T>
250 enum mode_t mode = RESET) {
257 pDofMap->
Reset(func);
260 pElem->InitialAssRes(WorkMat_grad, XCurr_grad, func);
268 WorkMat.Resize(iNextItem, 0);
270 #if GRADIENT_DEBUG > 0 && HAVE_FINITE == 1
271 if (!std::isfinite(dCoef)) {
272 silent_cerr(
"PutItem(" << iNextItem <<
", " << iRow <<
", " << iDofIndex <<
", " << dCoef <<
")" << std::endl);
277 WorkMat.PutItem(iNextItem++, iRow, iDofIndex, dCoef);
282 template <index_type N_rows>
286 for (
integer i = 0; i < N_rows; ++i) {
287 AddItem(iFirstRow + i, v(i + 1));
index_type iGetStartIndexLocal() const
void GetVec(integer iRow, Vector< Gradient< N_SIZE >, N_rows > &v, doublereal dCoef, LocalDofMap *pDofMap) const
GradientVectorHandler(const VectorHandler &vh)
GradientAssVec(SubVectorHandler &vh, enum mode_t mode=RESET)
void AddItem(integer iRow, const Gradient< N_SIZE > &g)
void AddItem(const integer iRow, const double dCoef)
static void InitialAssRes(T *pElem, SubVectorHandler &WorkVec, const VectorHandler &XCurr, enum FunctionCall func, enum mode_t mode=RESET)
void GetVec(integer iRow, Vector< double, N_rows > &v, doublereal dCoef, LocalDofMap *pDofMap) const
SubVectorHandler & WorkVec
static void InitialAssJac(T *pElem, SparseSubMatrixHandler &WorkMat, const VectorHandler &XCurr, enum FunctionCall func, LocalDofMap *pDofMap, enum mode_t mode=RESET)
void dGetCoef(integer iRow, doublereal &dVal, doublereal dCoef, LocalDofMap *pDofMap) const
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
SparseSubMatrixHandler & WorkMat
void SetDerivativeGlobal(index_type iGlobalDof, scalar_deriv_type dCoef)
static void AssRes(T *pElem, SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, enum FunctionCall func, enum mode_t mode=RESET)
GradientVectorHandler(const VectorHandler &vh)
void SetValuePreserve(scalar_func_type dVal)
static void AssJac(T *pElem, SparseSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, enum FunctionCall func, LocalDofMap *pDofMap, enum mode_t mode=RESET)
void Reset(enum FunctionCall func=UNKNOWN_FUNC)
GradientAssVec(SparseSubMatrixHandler &mh, enum mode_t mode=RESET)
void DerivativeResizeReset(LocalDofMap *pMap, index_type iStartGlobal, index_type iEndGlobal, MapVectorBase::GlobalScope s, scalar_deriv_type dVal)
index_type iGetGlobalDof(index_type iLocalDof) const
index_type iGetNumRows() const
void AddItem(integer iFirstRow, const Vector< Gradient< N_SIZE >, N_rows > &v)
void dGetCoef(integer iRow, Gradient< N_SIZE > &gVal, doublereal dCoef, LocalDofMap *pDofMap) const
scalar_deriv_type dGetDerivativeLocal(index_type iLocalDof) const
void AddItem(const integer iFirstRow, const Vector< doublereal, N_rows > &v)
index_type iGetEndIndexLocal() const
#define GRADIENT_ASSERT(expr)