source: issm/trunk/src/c/modules/Dux/Dux.cpp@ 4091

Last change on this file since 4091 was 4091, checked in by Eric.Larour, 15 years ago

renamed UpdateInputsFromVectorx to InputUpdateFromVectorx

File size: 1.6 KB
Line 
1/*!\file Dux
2 * \brief: diff between observed and modeled velocity
3 */
4
5#include "./Dux.h"
6
7#include "../../shared/shared.h"
8#include "../../include/include.h"
9#include "../../toolkits/toolkits.h"
10#include "../../EnumDefinitions/EnumDefinitions.h"
11#include "../SurfaceAreax/SurfaceAreax.h"
12
13void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters){
14
15 /*Intermediary*/
16 int i;
17 int gsize;
18 int found;
19 double fit=-1;
20 double S;
21 Element* element=NULL;
22
23 int analysis_type;
24
25 /*output: */
26 Vec du_g=NULL;
27
28 /*retrive parameters: */
29 parameters->FindParam(&analysis_type,AnalysisTypeEnum);
30
31 /*First, get elements and loads configured: */
32 elements-> Configure(elements,loads, nodes, vertices, materials,parameters);
33 nodes-> Configure(elements,loads, nodes, vertices, materials,parameters);
34 parameters->Configure(elements,loads, nodes, vertices, materials,parameters);
35
36 /*Compute surface area: */
37 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters);
38
39 /*add surface area to elements :*/
40 for(i=0;i<elements->Size();i++){
41 Element* element=(Element*)elements->GetObjectByOffset(i);
42 element->InputUpdateFromVector(&S,SurfaceAreaEnum,ConstantEnum);
43 }
44
45 /*Get size of matrix: */
46 gsize=nodes->NumberOfDofs(analysis_type);
47
48 /*Allocate du_g: */
49 du_g=NewVec(gsize);
50
51 /*Compute velocity difference: */
52 for (i=0;i<elements->Size();i++){
53 element=(Element*)elements->GetObjectByOffset(i);
54 element->Du(du_g);
55 }
56
57 /*Assemble vector: */
58 VecAssemblyBegin(du_g);
59 VecAssemblyEnd(du_g);
60
61 /*Assign output pointers: */
62 *pdu_g=du_g;
63
64}
Note: See TracBrowser for help on using the repository browser.