OOFEM 3.0
Loading...
Searching...
No Matches
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 - 2025 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
45namespace oofem {
46
50
52
53std::vector<std::unique_ptr<EnrichmentItem>> NucleationCriterion::nucleateEnrichmentItems()
54{
55 OOFEM_ERROR("Not implemented.")
56/*
57 std::vector<std::unique_ptr<EnrichmentItem>> eiList;
58 return eiList;
59*/
60}
61
65
67{
68 std :: string name;
69
70 // Instantiate enrichment function
71 auto &mir = dr.giveInputRecord(DataReader :: IR_crackNucleationRec, 1);
72 mir.giveRecordKeywordField(name);
73
74 mpEnrichmentFunc = classFactory.createEnrichmentFunction( name.c_str(), 1, mpDomain );
75 if ( mpEnrichmentFunc ) {
76 mpEnrichmentFunc->initializeFrom(mir);
77 } else {
78 OOFEM_ERROR( "failed to create enrichment function (%s)", name.c_str() );
79 }
80 return 1;
81}
82
83void NucleationCriterion :: appendInputRecords(DynamicDataReader &oDR)
84{
85 auto ir = std::make_unique<DynamicInputRecord>();
86
87 ir->setRecordKeywordField( this->giveInputRecordName(), 1 );
88
89
90// eiRec->setField(mEnrFrontIndex, _IFT_EnrichmentItem_front);
91// eiRec->setField(mPropLawIndex, _IFT_EnrichmentItem_propagationlaw);
92//
93// if ( mInheritBoundaryConditions ) {
94// eiRec->setField(_IFT_EnrichmentItem_inheritbc);
95// }
96
97 oDR.insertInputRecord(DataReader :: IR_crackNucleationRec, std::move(ir));
98
99
100// // Enrichment function
101// auto efRec = std::make_unique<DynamicInputRecord>();
102// mpEnrichmentFunc->giveInputRecord(* efRec);
103// oDR.insertInputRecord(DataReader :: IR_enrichFuncRec, std::move(efRec));
104//
105// // Geometry
106// auto geoRec = std::make_unique<DynamicInputRecord>();
107// mpBasicGeometry->giveInputRecord(* geoRec);
108// oDR.insertInputRecord(DataReader :: IR_geoRec, std::move(geoRec));
109//
110//
111// // Enrichment front
112// if ( mEnrFrontIndex != 0 ) {
113// auto efrRecStart = std::make_unique<DynamicInputRecord>();
114// mpEnrichmentFrontStart->giveInputRecord(* efrRecStart);
115// oDR.insertInputRecord(DataReader :: IR_enrichFrontRec, std::move(efrRecStart));
116//
117// auto efrRecEnd = std::make_unique<DynamicInputRecord>();
118// mpEnrichmentFrontEnd->giveInputRecord(* efrRecEnd);
119// oDR.insertInputRecord(DataReader :: IR_enrichFrontRec, std::move(efrRecEnd));
120// }
121//
122// // Propagation law
123// if ( mPropLawIndex != 0 ) {
124// auto plRec = std::make_unique<DynamicInputRecord>();
125// this->mpPropagationLaw->giveInputRecord(* plRec);
126// oDR.insertInputRecord(DataReader :: IR_propagationLawRec, std::move(plRec));
127// }
128}
129
130} /* namespace oofem */
virtual InputRecord & giveInputRecord(InputRecordType irType, int recordId)=0
void insertInputRecord(InputRecordType type, std::unique_ptr< InputRecord > record)
virtual void giveRecordKeywordField(std ::string &answer, int &value)=0
Reads the record id field (type of record) and its corresponding number.
NucleationCriterion(Domain *ipDomain)
virtual int instanciateYourself(DataReader &dr)
virtual void initializeFrom(InputRecord &ir)
virtual const char * giveInputRecordName() const =0
std::unique_ptr< EnrichmentFunction > mpEnrichmentFunc
virtual std::vector< std::unique_ptr< EnrichmentItem > > nucleateEnrichmentItems()
#define OOFEM_ERROR(...)
Definition error.h:79
ClassFactory & classFactory

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011