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

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

Changing to new framework where analysis_type and sub_analysis_type are picked up in the parameters, whenever needed.
This greatly simplifies the API of the code -> don't have to carry along analysis_type and sub_analysis_type.

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