|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Drastic Change in "y" After Call to CVNlsNewton()Hello,
Thank you for the assistance on the previous problem, that issue has been resolved. I am trying to make some headway implementing sundials into my FEA code. However, at the first requested time "tout", the solution is obviously incorrect. I have implemented this algorithm in MATLAB with success, and am seeing very different trends in the C++ implementation. The drastic change in "y" appears to occur at the RHS function call on Line 2668 of covde.c in the CVNlsNewton() function. For example, I should expect values of y around [.79 .77 .75] but instead CVode is returning something like [101.78 100.2 100.2]. Definitely, a far cry from the values I expect from my validated MATLAB code. If needed, here are my setting and initializations. These are the same settings I am using in my MATLAB implementation that has worked. t0 = 0.0; //y = N_VMake_Serial(totalNumDof,u_s); y = N_VNew_Serial(totalNumDof); abstol = N_VNew_Serial(totalNumDof); ydot = N_VNew_Serial(totalNumDof); reltol = 1e-4; for (int i=0;i<totalNumDof;i++) { NV_Ith_S(y,i) = u_s[i]; NV_Ith_S(abstol,i) = reltol*100.0; } cvode_mem = CVodeCreate(CV_BDF,CV_NEWTON); flag = CVodeInit(cvode_mem,RHSfunction, t0, y); flag = CVodeSVtolerances(cvode_mem, reltol, abstol); flag = CVDense(cvode_mem, totalNumDof); flag = CVodeSetUserData(cvode_mem,this); Thanks, Brian |
|
|
|
|
|
Re: Drastic Change in "y" After Call to CVNlsNewton()I have determined this was a minor problem with a pointer being set in my RHSfunction. Sorry about the additional post. I am finally starting to work with the N_Vector type.
|
| Free embeddable forum powered by Nabble | Forum Help |