OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
nucleationcriterion.C
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #include "nucleationcriterion.h"
36 #include "error.h"
37 #include "enrichmentitem.h"
38 #include "dynamicinputrecord.h"
39 #include "dynamicdatareader.h"
41 #include "classfactory.h"
42 
43 #include <memory>
44 
45 namespace oofem {
46 
48  mpDomain(ipDomain),
49  mpEnrichmentFunc(NULL)
50 {
51 
52 }
53 
55 {
56  delete mpEnrichmentFunc;
57 }
58 
59 std::vector<std::unique_ptr<EnrichmentItem>> NucleationCriterion::nucleateEnrichmentItems()
60 {
61  OOFEM_ERROR("Not implemented.")
62 
63  std::vector<std::unique_ptr<EnrichmentItem>> eiList;
64  return std::move( eiList );
65 }
66 
68 
69  return IRRT_OK;
70 }
71 
73 {
74  IRResultType result; // Required by IR_GIVE_FIELD macro
75  std :: string name;
76 
77  // Instantiate enrichment function
79  result = mir->giveRecordKeywordField(name);
80 
81  if ( result != IRRT_OK ) {
82  mir->report_error(this->giveClassName(), __func__, "", result, __FILE__, __LINE__);
83  }
84 
86  if ( mpEnrichmentFunc != NULL ) {
88  } else {
89  OOFEM_ERROR( "failed to create enrichment function (%s)", name.c_str() );
90  }
91 
92  return IRRT_OK;
93 }
94 
96 {
98 
100 
101 
102 // eiRec->setField(mEnrFrontIndex, _IFT_EnrichmentItem_front);
103 // eiRec->setField(mPropLawIndex, _IFT_EnrichmentItem_propagationlaw);
104 //
105 // if ( mInheritBoundaryConditions ) {
106 // eiRec->setField(_IFT_EnrichmentItem_inheritbc);
107 // }
108 
110 
111 
112 // // Enrichment function
113 // DynamicInputRecord *efRec = new DynamicInputRecord();
114 // mpEnrichmentFunc->giveInputRecord(* efRec);
115 // oDR.insertInputRecord(DataReader :: IR_enrichFuncRec, efRec);
116 //
117 // // Geometry
118 // DynamicInputRecord *geoRec = new DynamicInputRecord();
119 // mpBasicGeometry->giveInputRecord(* geoRec);
120 // oDR.insertInputRecord(DataReader :: IR_geoRec, geoRec);
121 //
122 //
123 // // Enrichment front
124 // if ( mEnrFrontIndex != 0 ) {
125 // DynamicInputRecord *efrRecStart = new DynamicInputRecord();
126 // mpEnrichmentFrontStart->giveInputRecord(* efrRecStart);
127 // oDR.insertInputRecord(DataReader :: IR_enrichFrontRec, efrRecStart);
128 //
129 // DynamicInputRecord *efrRecEnd = new DynamicInputRecord();
130 // mpEnrichmentFrontEnd->giveInputRecord(* efrRecEnd);
131 // oDR.insertInputRecord(DataReader :: IR_enrichFrontRec, efrRecEnd);
132 // }
133 //
134 // // Propagation law
135 // if ( mPropLawIndex != 0 ) {
136 // DynamicInputRecord *plRec = new DynamicInputRecord();
137 // this->mpPropagationLaw->giveInputRecord(* plRec);
138 // oDR.insertInputRecord(DataReader :: IR_propagationLawRec, plRec);
139 // }
140 }
141 
142 } /* namespace oofem */
Class and object Domain.
Definition: domain.h:115
Class representing the implementation of a dynamic data reader for in-code use.
virtual void appendInputRecords(DynamicDataReader &oDR)
virtual std::vector< std::unique_ptr< EnrichmentItem > > nucleateEnrichmentItems()
Class representing the abstraction for input data source.
Definition: datareader.h:50
EnrichmentFunction * createEnrichmentFunction(const char *name, int num, Domain *domain)
Definition: classfactory.C:301
virtual void report_error(const char *_class, const char *proc, InputFieldType id, IRResultType result, const char *file, int line)=0
Prints the error message.
NucleationCriterion(Domain *ipDomain)
virtual IRResultType giveRecordKeywordField(std::string &answer, int &value)=0
Reads the record id field (type of record) and its corresponding number.
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual IRResultType initializeFrom(InputRecord *ir)
virtual InputRecord * giveInputRecord(InputRecordType irType, int recordId)=0
Returns input record corresponding to given InputRecordType value and its record_id.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual const char * giveClassName() const =0
Class representing the general Input Record.
Definition: inputrecord.h:101
Class representing the a dynamic Input Record.
ClassFactory & classFactory
Definition: classfactory.C:59
void setRecordKeywordField(std::string keyword, int number)
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual int instanciateYourself(DataReader &dr)
EnrichmentFunction * mpEnrichmentFunc
virtual const char * giveInputRecordName() const =0
void insertInputRecord(InputRecordType type, InputRecord *record)
Main purpose of this class it the possibility to add new input records in code.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011