70 outputStrem = fopen(
"freem.bmf",
"w");
72 fprintf(outputStrem,
"nbnodes %d nbelem %d \n", nnodes, nelem);
77 for (
int i = 1; i <= nnodes; i++ ) {
85 for (
int i = 1; i <= nnodes; i++ ) {
88 density = nodalDensities.
at(i);
93 for (
int i = 1; i <= nelem; i++ ) {
96 OOFEM_ERROR(
"unsupported element type (not a bilinear quad)");
99 fprintf( outputStrem,
"backgroundMeshElem %d nodes 4 %d %d %d %d\n", i,
113 int neighbour, candidate, found, jelemNodes;
116 const IntArray *candidateConnectivity;
120 std :: list< int >queue;
124 for (
int i = 1; i <= nnodes; i++ ) {
132 while ( !queue.empty() ) {
134 candidate = * ( queue.begin() );
135 queue.erase( queue.begin() );
140 for (
int j = 1; j <= candidateConnectivity->
giveSize(); j++ ) {
143 for (
int k = 1; k <= jelemNodes; k++ ) {
145 if ( neighbour == candidate ) {
153 if ( ( ( nodalDensities.
at(neighbour) / nodalDensities.
at(candidate) ) > 1.3 ) &&
154 ( nodalDensities.
at(neighbour) > 1.0 * dist ) ) {
156 nodalDensities.
at(neighbour) =
max( 1.0 * dist, nodalDensities.
at(candidate) );
160 for (
int q: queue ) {
161 if ( q == neighbour ) {
168 queue.push_front(neighbour);
172 }
else if ( ( nodalDensities.
at(neighbour) - nodalDensities.
at(candidate) ) / dist > 2.5 ) {
174 nodalDensities.
at(neighbour) = nodalDensities.
at(candidate) + 2.2 * dist;
178 for (
int q: queue ) {
179 if ( q == neighbour ) {
186 queue.push_front(neighbour);
int createInput(Domain *d, TimeStep *tStep)
Creates the mesher input, containing the required mesh density information.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
REGISTER_Mesher(FreemInterface, MPT_FREEM)
double & at(int i)
Coefficient access function.
void smoothNodalDensities(Domain *d, FloatArray &nodalDensities, TimeStep *tStep)
Service for smoothing the densities for freem.
int max(int i, int j)
Returns bigger value form two given decimals.
ConnectivityTable * giveConnectivityTable()
Returns receiver's associated connectivity table.
Abstract base class for all finite elements.
int giveNumberOfElements() const
Returns number of elements in domain.
virtual double giveCoordinate(int i)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual double giveRequiredDofManDensity(int num, TimeStep *tStep, int relative=0)=0
Returns the required mesh size n given dof manager.
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
ErrorEstimator * giveErrorEstimator()
Returns Error Estimator associated to receiver.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
#define OOFEM_LOG_INFO(...)
Element * giveElement(int n)
Service for accessing particular domain fe element.
virtual RemeshingCriteria * giveRemeshingCrit()=0
Returns reference to associated remeshing criteria.
Class representing vector of real numbers.
const IntArray * giveDofManConnectivityArray(int dofman)
virtual returnCode createMesh(TimeStep *tStep, int domainNumber, int domainSerNum, Domain **dNew)
Runs the mesh generation, mesh will be written to corresponding domain din file.
virtual FloatArray * giveCoordinates()
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class implementing node in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Class representing solution step.