49 #include <boost/concept_check.hpp> 69 const char *__proc =
"initializeFrom";
88 double crackLength_projection;
89 double crackLength_sqrt;
100 double weight, totWeight;
104 std::vector< FloatArray > pointsVector;
113 crackLength_projection = 0.;
114 crackLength_sqrt = 0.;
117 for (
int i = 0; i < elem->giveNumberOfIntegrationRules(); i++ ) {
120 for (
auto &gp: *iRule ) {
123 elem->giveIPValue(tmp, gp, IST_DamageScalar, tStep);
125 elem->giveIPValue(strainVector, gp, IST_StrainTensor, tStep);
129 weight = elem->computeVolumeAround(gp);
132 elem->giveIPValue(tmp, gp, IST_CharacteristicLength, tStep);
133 elementLength = tmp.
at(1);
134 elem->giveIPValue(crackVector, gp, IST_CrackVector, tStep);
135 crackVector.
times(1./damage);
139 princDir.
at(1,1) = crackVector.
at(2);
140 princDir.
at(2,1) = -crackVector.
at(1);
142 princDir.
at(1,2) = crackVector.
at(1);
143 princDir.
at(2,2) = crackVector.
at(2);
146 strainVector = {strainVector(0), strainVector(1), strainVector(6)*0.5};
151 crackWidth += elementLength * princStrain.
at(1) * damage * weight;
152 crackLength_projection += elem->giveCharacteristicSize(gp, crackVector,
ECSM_Projection) * weight;
155 if ( crackVector.
at(1) != 0. ) {
156 double contrib = atan( crackVector.
at(2) / crackVector.
at(1) ) * 180./3.1415926;
157 if ( contrib < 0. ) {
159 }
else if ( contrib > 180. ) {
162 crackAngle += contrib * weight;
164 crackAngle += 90. * weight;
170 double length3 = elem->giveCharacteristicSize(gp, crackVector,
ECSM_Oliver1);
172 double length5 = elem->giveCharacteristicSize(gp, crackVector,
ECSM_Projection);
177 crackLength_projection += 0.;
178 crackLength_sqrt += 0.;
183 if ( totWeight > 0. ) {
184 crackWidth /= totWeight;
185 crackLength_projection /= totWeight;
186 crackLength_sqrt /= totWeight;
187 crackAngle /= totWeight;
192 pointsVector.emplace_back({
196 crackLength_projection,
204 std :: stringstream strCracks;
213 std :: ofstream file;
214 file.open( iName.data() );
217 file << std :: scientific;
219 file <<
"#elem\twidth\tangle\tlength_project\tlength_sqrt\n";
221 for (
auto posVec: iPoints ) {
222 for (
auto &val : posVec ) {
bool testTimeStepOutput(TimeStep *tStep)
Tests if given time step output is required.
static void givePlaneStressVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 2d stress vector transformation matrix from standard vector transformation matrix...
double & at(int i)
Coefficient access function.
virtual ~CrackExportModule()
Destructor.
static void writeToOutputFile(const std::string &iName, const std::vector< FloatArray > &iPoints)
virtual void initialize()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Represents export output module - a base class for all output modules.
#define _IFT_CrackExportModule_cs
Abstract base class representing integration rule.
CrossSection * giveCrossSection(int n)
Service for accessing particular domain cross section model.
EngngModel * emodel
Problem pointer.
virtual void initialize()
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
double at(int i, int j) const
Coefficient access function.
#define _IFT_CrackExportModule_threshold
Class representing vector of real numbers.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void doOutput(TimeStep *tStep, bool forcedOutput)
Writes the output.
virtual void terminate()
Terminates the receiver.
void times(double s)
Multiplies receiver with scalar.
std::vector< std::unique_ptr< Element > > & giveElements()
Abstract base class representing the "problem" under consideration.
This one-purpose export module serves for estimation of the total water loss.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
bool containsSorted(int value) const
Checks if sorted receiver contains a given value.
std::string giveOutputBaseFileName(TimeStep *tStep)
Gives the appropriate name (minus specific file extension).
Class representing solution step.
REGISTER_ExportModule(ErrorCheckingExportModule)