1 | /*!\file TriaHook.c
|
---|
2 | * \brief: implementation of the TriaHook object
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*Headers:*/
|
---|
6 | /*{{{*/
|
---|
7 | #ifdef HAVE_CONFIG_H
|
---|
8 | #include <config.h>
|
---|
9 | #else
|
---|
10 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
11 | #endif
|
---|
12 |
|
---|
13 | #include <stdio.h>
|
---|
14 | #include <string.h>
|
---|
15 | #include "../objects.h"
|
---|
16 | #include "../../EnumDefinitions/EnumDefinitions.h"
|
---|
17 | #include "../../shared/shared.h"
|
---|
18 | #include "../../Container/Container.h"
|
---|
19 | #include "../../include/include.h"
|
---|
20 | /*}}}*/
|
---|
21 |
|
---|
22 | /*Object constructors and destructor*/
|
---|
23 | /*FUNCTION TriaHook::TriaHook(){{{*/
|
---|
24 | TriaHook::TriaHook(){
|
---|
25 | numanalyses=UNDEF;
|
---|
26 | this->hnodes=NULL;
|
---|
27 | this->hmatice=NULL;
|
---|
28 | this->hmatpar=NULL;
|
---|
29 | }
|
---|
30 | /*}}}*/
|
---|
31 | /*FUNCTION TriaHook::~TriaHook(){{{*/
|
---|
32 | TriaHook::~TriaHook(){
|
---|
33 | int i;
|
---|
34 |
|
---|
35 | for(i=0;i<this->numanalyses;i++){
|
---|
36 | if (this->hnodes[i]) delete this->hnodes[i];
|
---|
37 | }
|
---|
38 | delete [] this->hnodes;
|
---|
39 | delete hmatice;
|
---|
40 | delete hmatpar;
|
---|
41 |
|
---|
42 | }
|
---|
43 | /*}}}*/
|
---|
44 | /*FUNCTION TriaHook::TriaHook(int in_numanalyses,int matice_id, int matpar_id){{{*/
|
---|
45 | TriaHook::TriaHook(int in_numanalyses,int matice_id, IoModel* iomodel){
|
---|
46 |
|
---|
47 | /*intermediary: */
|
---|
48 | int matpar_id;
|
---|
49 |
|
---|
50 | /*retrieve parameters: */
|
---|
51 | iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
|
---|
52 |
|
---|
53 | this->numanalyses=in_numanalyses;
|
---|
54 | this->hnodes= new Hook*[in_numanalyses];
|
---|
55 | this->hmatice=new Hook(&matice_id,1);
|
---|
56 | this->hmatpar=new Hook(&matpar_id,1);
|
---|
57 |
|
---|
58 | //Initialize hnodes as NULL
|
---|
59 | for(int i=0;i<this->numanalyses;i++){
|
---|
60 | this->hnodes[i]=NULL;
|
---|
61 | }
|
---|
62 |
|
---|
63 | }
|
---|
64 | /*}}}*/
|
---|
65 |
|
---|
66 | /*FUNCTION TriaHook::SetHookNodes{{{*/
|
---|
67 | void TriaHook::SetHookNodes(int* node_ids,int analysis_counter){
|
---|
68 |
|
---|
69 | /*initialize hook*/
|
---|
70 | this->hnodes[analysis_counter]=new Hook(node_ids,3);
|
---|
71 | }
|
---|
72 | /*}}}*/
|
---|