78 std :: string poiFileName;
91 std :: ifstream file(poiFileName.c_str(), std :: ios :: in);
92 if ( !file.is_open() ) {
93 OOFEM_ERROR(
"Failed to open time data file: %s\n", poiFileName.c_str() );
98 while ( file >> poi.
id >> poi.
x >> poi.
y >> poi.
z >> poi.
region ) {
113 fprintf(stream,
"# POI DataFile\n");
114 fprintf( stream,
"Output for time %f\n", tStep->
giveTargetTime() );
140 if ( ( answer = fopen(fileName.c_str(),
"w") ) == NULL ) {
141 OOFEM_ERROR(
"failed to open file %s", fileName.c_str() );
160 poiCoords.
at(1) = poi.
x;
161 poiCoords.
at(2) = poi.
y;
162 poiCoords.
at(3) = poi.
z;
165 for ( i = 1; i <= n; i++ ) {
167 fprintf(stream,
"\n\nPOI_INTVAR_DATA %d\n", type);
184 toMap.
at(1) = ( int ) valID;
188 poiCoords.
at(1) = poi.x;
189 poiCoords.
at(2) = poi.y;
190 poiCoords.
at(3) = poi.z;
198 fprintf(stream,
"%10d ", poi.id);
199 for (
auto &x : val ) {
200 fprintf( stream,
" %15e", x );
203 fprintf(stream,
"\n");
223 return this->
mapper.get();
241 for (
int i = 1; i <= n; i++ ) {
255 if ( valID == DisplacementVector ) {
257 }
else if ( valID == FluxVector || valID == Humidity ) {
265 fprintf(stream,
"SCALARS prim_scalar_%d\n", (
int ) valID);
267 fprintf(stream,
"VECTORS vector_%d float\n", (
int ) valID);
276 coords.at(1) = poi.x;
277 coords.at(3) = poi.z;
285 fprintf(stream,
"%10d ", poi.id);
286 for (
auto &p : pv ) {
287 fprintf( stream,
" %15e ", p );
290 fprintf(stream,
"\n");
292 OOFEM_ERROR(
"no element containing POI(%e,%e,%e) found",
293 coords.at(1), coords.at(2), coords.at(3) );
#define _IFT_POIExportModule_poifilename
The base class for all spatial localizers.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
The class implements the transfer of state variables based on Least square fit over old mesh integrat...
bool testTimeStepOutput(TimeStep *tStep)
Tests if given time step output is required.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
The class implements the closest integration point transfer of state variables.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
double & at(int i)
Coefficient access function.
POIEM_MapperType
Smoother type.
void clear()
Clears receiver (zero size).
void exportPrimVarAs(UnknownType valID, FILE *stream, TimeStep *tStep)
Exports single variable.
void exportPrimaryVars(FILE *stream, TimeStep *tStep)
Export primary variables.
virtual void initialize()
double giveTargetTime()
Returns target time.
Abstract base class for all finite elements.
InternalStateValueType
Determines the type of internal variable.
The class representing the general material model mapping algorithm.
Represents export output module - a base class for all output modules.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual void terminate()
Terminates the receiver.
void exportIntVarAs(InternalStateType valID, FILE *stream, TimeStep *tStep)
Exports single variable.
enum oofem::POIExportModule::POIEM_MapperType mtype
virtual void initialize()
virtual ~POIExportModule()
Destructor.
#define _IFT_POIExportModule_mtype
EngngModel * emodel
Problem pointer.
UnknownType
Type representing particular unknown (its physical meaning).
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
virtual int __mapVariable(FloatArray &answer, const FloatArray &coords, InternalStateType type, TimeStep *tStep)=0
Maps and update the unknown of given type from old mesh oldd to new mesh to which gp belongs to...
std::unique_ptr< MaterialMappingAlgorithm > mapper
Mapper.
Represents POI (Point Of Interest) export module.
Set * giveSet(int n)
Service for accessing particular domain set.
FILE * giveOutputStream(TimeStep *tStep)
Returns the output stream for given solution step.
std::list< POI_dataType > POIList
List of POIs.
void exportIntVars(FILE *stream, TimeStep *tStep)
Export internal variables.
virtual void doOutput(TimeStep *tStep, bool forcedOutput=false)
Writes the output.
Class representing vector of real numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
The class implements the transfer of state variables based on projection using shape functions...
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual Element * giveElementClosestToPoint(FloatArray &lcoords, FloatArray &closest, const FloatArray &coords, int region=0)=0
Returns the element closest to a given point.
MaterialMappingAlgorithm * giveMapper()
void readPOIFile(const std::string &poiFileName)
#define _IFT_POIExportModule_vars
IntArray internalVarsToExport
List of InternalStateType values, identifying the selected vars for export.
IntArray primaryVarsToExport
List of primary unknowns to export.
virtual void __init(Domain *dold, IntArray &varTypes, const FloatArray &coords, Set &sourceElemSet, TimeStep *tStep, bool iCohesiveZoneGP=false)=0
Initializes the receiver state before mapping.
Abstract base class representing the "problem" under consideration.
virtual void finish(TimeStep *tStep)=0
Finishes the mapping for given time step.
#define _IFT_POIExportModule_primvars
virtual void computeField(ValueModeType mode, TimeStep *tStep, const FloatArray &lcoords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
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.
std::string giveOutputBaseFileName(TimeStep *tStep)
Gives the appropriate name (minus specific file extension).
#define OOFEM_WARNING(...)
Class representing solution step.
REGISTER_ExportModule(ErrorCheckingExportModule)